Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create /user.json get route + test #367

Merged
merged 2 commits into from
Sep 21, 2020
Merged

Create /user.json get route + test #367

merged 2 commits into from
Sep 21, 2020

Conversation

peterkos
Copy link
Contributor

Fixes #222

New route /user.json that, when a user is signed in, returns user data:

{
  "id": 4582,
  "created_at": "2019-12-05T21:26:22.000Z",
  "updated_at": "2020-09-20T07:55:36.000Z",
  "email": "pkos99@gmail.com",
  "provider": null,
  "uid": null,
  "reminder_sent_at": "2019-12-05T21:26:22.000Z",
  "role": "admin_limited_access",
  "is_active": true,
  "receive_weekly_report": false,
  "first_name": "Peter",
  "last_name": "Kos"
}

Notes:

  • Restricted to json format only as no frontend exists for this feature
  • I had to bypass devise's registration controller because it wouldn't allow me to create a show method in there, nor would the devise route handle an incoming GET

Restricted to .json format as no page needs to exist for this
Bypass devise controller because devise doesn’t allow `show` method for some reason
@peterkos peterkos added the 2.0 label Sep 21, 2020
@peterkos peterkos self-assigned this Sep 21, 2020
config/routes.rb Outdated Show resolved Hide resolved
app/controllers/users_controller.rb Outdated Show resolved Hide resolved
@peterkos peterkos linked an issue Sep 21, 2020 that may be closed by this pull request
@cbaudouinjr cbaudouinjr merged commit a9e14f5 into 2.0 Sep 21, 2020
@cbaudouinjr cbaudouinjr deleted the hm-222 branch September 21, 2020 05:11
sman591 pushed a commit that referenced this pull request Sep 21, 2020
# [1.23.0](v1.22.4...v1.23.0) (2020-09-21)

### Bug Fixes

* CodeClimate 2.0 fixes ([#374](#374)) ([](746bbfc))
* Fixes failing test cases from [#242](#242) ([#364](#364)) ([](113cd61))
* Fixes various Hound issues for 2.0 ([#370](#370)) ([](434cfb3))
* Resolves merge conflicts with 2.0->master ([#372](#372)) ([](eae9926)), closes [#215](#215) [#215](#215) [#207](#207) [#208](#208) [#212](#212) [#219](#219) [#221](#221) [#236](#236) [#236](#236) [#250](#250) [#268](#268) [#280](#280) [#282](#282) [#298](#298)
* **config:** Removes disable_account_registration from database ([#247](#247)) ([](82a7ff4))
* **dashboard:** Map data refactored for faster load times ([#269](#269)) ([](03e632c))
* **dashboard:** Switches map to use different geocoder, reenables map ([#224](#224)) ([](30e3a2f))
* **Dashboard:** Fixes missing location data in map ([#324](#324)) ([](388c9bd))
* **deps:** Updates the locked Ruby version ([#340](#340)) ([](e0e537c))
* **docs:** Refactors page titles and makes API pages visible again ([#320](#320)) ([](8617981))
* **questionnaire:** added phone number requirements ([#283](#283)) ([](09167ae))
* Hackathon names now consistently on newline, wrapping is centered ([#358](#358)) ([](2e9379f))
* School text-box dropdown in manage/questionnaires/edit missing background  ([#296](#296)) ([](c9d6658))
* Text centering on application page  ([#361](#361)) ([](0237965))
* **bus_captain:** Alerts admins if a bus captain is removed ([#270](#270)) ([](28913f7))
* Shows manage button for admin_limited_access ([#331](#331)) ([](cb16869))
* **login:** Removes always visible login error ([#263](#263)) ([](513e1c2))
* **questionnaire:** Fixes error when trying to view a questionnaire modified by a deleted admin ([#238](#238)) ([](f07ec28)), closes [#215](#215) [#215](#215) [#207](#207) [#208](#208) [#212](#212) [#219](#219) [#221](#221)
* **questionnaire:** School autocomplete matches form field width ([#278](#278)) ([](e4169a7))

### Code Refactoring

* `first_name` and `last_name` move from `questionnaire` to `user` ([#241](#241)) ([](6266f5a)), closes [#244](#244) [#downwith2](https://github.com/codeRIT/hackathon-manager/issues/downwith2) [#222](#222) [#273](#273) [#215](#215) [#215](#215) [#207](#207) [#208](#208) [#212](#212) [#219](#219) [#221](#221) [#236](#236) [#236](#236) [#250](#250) [#268](#268) [#263](#263) [#275](#275) [#235](#235) [#247](#247) [#238](#238) [#215](#215) [#215](#215) [#207](#207) [#208](#208) [#212](#212) [#219](#219) [#221](#221) [#329](#329) [#326](#326) [#324](#324) [#291](#291) [#272](#272) [#278](#278)
* Adds GSDP info, cleans Dokku docs ([#356](#356)) ([](54d2cea))
* Changes "Applications" to "Questionnaires" in map ([#326](#326)) ([](675b3f6))
* Cleans Questionnaire for MyMLH V3 ([#338](#338)) ([](31b418d))
* Cleans update method in rsvps_controller ([#305](#305)) ([](fe66870))
* Redesigns password reset pages ([#308](#308)) ([](69e8d6e))
* Renames "Guides" to "Docs" ([#353](#353)) ([](12cc746))
* Renames user roles, improves security ([](58b5849))
* **config:** Adjusts registration verbiage to always allow user registration ([#232](#232)) ([](1a31861))
* **docs:** Updates Environment Variable docs ([#300](#300)) ([](1599fe1))
* Updates 24hr reminder to remove MyMLH reference ([#302](#302)) ([](9e6fe39))
* **docs:** Updates Messages and customization instructions ([#321](#321)) ([](a767446))
* **questionnaire:** No longer deletes user with questionnaire ([#287](#287)) ([](ac720d9))
* **skylight:** Removes Skylight ([#249](#249)) ([](2808058))

### Documentation

* Add guide for local API setup, update api-usage slightly ([#235](#235)) ([](d1a01f8))
* Migration guide for 2.0 ([#368](#368)) ([](3745d9c)), closes [#283](#283) [#296](#296) [#242](#242) [#364](#364) [#361](#361) [#270](#270) [#175](#175) [#215](#215) [#215](#215) [#207](#207) [#208](#208) [#212](#212) [#358](#358)

### Features

* Automatically remind people to RSVP ([#175](#175)) ([](d87269d)), closes [#215](#215) [#215](#215) [#207](#207) [#208](#208) [#212](#212)
* Creates /user.json get route ([#367](#367)) ([](a9e14f5))
* Updates HackathonManager to 2.0 ([](0070cd4))
* **Dashboard:** Redesigns sidebar with category labels ([#290](#290)) ([](abcf634))
* **docs:** Adds new Resources page ([#318](#318)) ([](9c61d1f))
* **docs:** Initial documentation for 2.0 ([#291](#291)) ([](a062140))
* **messages:** Adds a confirmation modal to send messages ([#272](#272)) ([](79831f6))
* **messages:** Transitions from SparkPost to SendGrid ([#285](#285)) ([](5e96a9c))
* **questionnaires:** Allows directors to block new questionnaires ([#279](#279)) ([](5e03082))
* Updates MyMLH to V3 ([#329](#329)) ([](ede300f))
* **users:** Adds ability to view all users and admins ([#216](#216)) ([](c119c9a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access user-facing data via non-admin routes on API
3 participants