Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

#161291007 Implement user profile update route #24

Merged
merged 2 commits into from
Nov 8, 2018

Conversation

Darthrighteous
Copy link
Collaborator

@Darthrighteous Darthrighteous commented Nov 4, 2018

What does this PR do?

Enable user profile to be updated

Description of Task to be completed?

  • set up Multer to handle multipart/form-data, for avatar uploads.
  • set up a Cloudinary account for user avatar storage.
  • set up the PATCH /users/:userId route to update a user's profile
  • fix error handling middleware

How should this be manually tested?

  • clone the repository, cd into it, checkout this branch feature/161291007/user-profile-update
  • set up your .env variables and local database
  • run npm install to install required packages
  • run npm start to start up the server
  • use postman(or any api testing tool) to test the following routes route
  • create a user using the route POST http://localhost:3000/api/v1/users/signup providing necessary request body as shown in screen shots below
  • update the users profile with the route PATCH http://localhost:3000/api/v1/users/:userid providing necessary request body as shown in screen shots below

Any background context you want to provide?

N/A

What are the relevant pivotal tracker stories?

#161291007

Screenshots (if appropriate)

Signup a user:
screen shot 2018-11-05 at 12 10 49 am

Update the user's profile:
screen shot 2018-11-08 at 4 42 17 pm

Questions:

  • What should be our size(dimensions and file size) for the user avatar?
  • Do we want the update profile route functioning on an unverified account? I didn't add that check as the verification functionality isn't up yet.
  • Our create token function currently can't create a token that doesn't expire, do we want all tokens to expire?

routes/api/users.js Outdated Show resolved Hide resolved
@Darthrighteous Darthrighteous temporarily deployed to valinor-ah-backend-stagi-pr-24 November 4, 2018 23:30 Inactive
@Darthrighteous Darthrighteous force-pushed the feature/161291007/user-profile-update branch from 5d40b98 to 59fa6f6 Compare November 4, 2018 23:31
@coveralls
Copy link

coveralls commented Nov 4, 2018

Pull Request Test Coverage Report for Build 352

  • 61 of 61 (100.0%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 89.896%

Totals Coverage Status
Change from base Build 344: -0.4%
Covered Lines: 266
Relevant Lines: 281

💛 - Coveralls

routes/api/users.js Outdated Show resolved Hide resolved
@KvNGCzA
Copy link
Contributor

KvNGCzA commented Nov 5, 2018

@Darthrighteous

What should be our size(dimensions and file size) for the user avatar?

I think we should use 200 x 200 as the minimum dimensions and 1MB as the maximum file size

Do we want the update profile route functioning on an unverified account? I didn't add that check as the verification functionality isn't up yet.

It is important that route only functions for a verified user

Our create token function currently can't create a token that doesn't expire, do we want all tokens to expire?

I'm good with the token not expiring

@Darthrighteous Darthrighteous force-pushed the feature/161291007/user-profile-update branch from 59fa6f6 to a6977d9 Compare November 6, 2018 09:35
@Darthrighteous Darthrighteous temporarily deployed to valinor-ah-backend-stagi-pr-24 November 6, 2018 09:35 Inactive
routes/api/users.js Outdated Show resolved Hide resolved
routes/api/users.js Outdated Show resolved Hide resolved
server/controllers/UsersController.js Outdated Show resolved Hide resolved
@Darthrighteous Darthrighteous force-pushed the feature/161291007/user-profile-update branch from a6977d9 to 4568327 Compare November 6, 2018 09:37
@Darthrighteous Darthrighteous temporarily deployed to valinor-ah-backend-stagi-pr-24 November 6, 2018 09:37 Inactive
app.js Show resolved Hide resolved
@Darthrighteous Darthrighteous force-pushed the feature/161291007/user-profile-update branch from 4568327 to a415d9e Compare November 6, 2018 11:02
@Darthrighteous Darthrighteous temporarily deployed to valinor-ah-backend-stagi-pr-24 November 6, 2018 11:02 Inactive
@Darthrighteous Darthrighteous force-pushed the feature/161291007/user-profile-update branch 2 times, most recently from dd05516 to d2204d8 Compare November 6, 2018 11:06
@Darthrighteous Darthrighteous temporarily deployed to valinor-ah-backend-stagi-pr-24 November 6, 2018 11:06 Inactive
routes/api/users.js Outdated Show resolved Hide resolved
@Darthrighteous Darthrighteous force-pushed the feature/161291007/user-profile-update branch from d2204d8 to 3c03a22 Compare November 7, 2018 12:37
@Darthrighteous Darthrighteous temporarily deployed to valinor-ah-backend-stagi-pr-24 November 7, 2018 12:37 Inactive
server/controllers/UsersController.js Outdated Show resolved Hide resolved
routes/api/users.js Outdated Show resolved Hide resolved
@Darthrighteous Darthrighteous force-pushed the feature/161291007/user-profile-update branch from 3c03a22 to 531d0e3 Compare November 7, 2018 12:42
@Darthrighteous Darthrighteous temporarily deployed to valinor-ah-backend-stagi-pr-24 November 7, 2018 12:42 Inactive
@Darthrighteous Darthrighteous force-pushed the feature/161291007/user-profile-update branch from 531d0e3 to c7a55cf Compare November 7, 2018 17:05
@Darthrighteous Darthrighteous temporarily deployed to valinor-ah-backend-stagi-pr-24 November 7, 2018 17:05 Inactive
@Darthrighteous Darthrighteous force-pushed the feature/161291007/user-profile-update branch from c7a55cf to 8610965 Compare November 7, 2018 17:21
@Darthrighteous Darthrighteous temporarily deployed to valinor-ah-backend-stagi-pr-24 November 7, 2018 17:21 Inactive
@Darthrighteous Darthrighteous force-pushed the feature/161291007/user-profile-update branch from 8610965 to 5227a0b Compare November 7, 2018 17:23
@Darthrighteous Darthrighteous temporarily deployed to valinor-ah-backend-stagi-pr-24 November 7, 2018 17:23 Inactive
@Darthrighteous Darthrighteous force-pushed the feature/161291007/user-profile-update branch from 5227a0b to 035b6ff Compare November 8, 2018 09:22
@Darthrighteous Darthrighteous temporarily deployed to valinor-ah-backend-stagi-pr-24 November 8, 2018 09:22 Inactive
- add profile columns to the user table
- build route to update a user's profile
- implement cloudinary image upload for profile avatars
- fix error handler

[Finishes #161291007]
- remove backend functionality to upload image(multipart/form-data)
- add validations on user update route
- update babel packages to fix transpilation problem on heroku

[#161291007]
@KvNGCzA
Copy link
Contributor

KvNGCzA commented Nov 8, 2018

@mbilesanmi LGTM.

1 similar comment
@tersoo-atsen
Copy link
Contributor

@mbilesanmi LGTM.

@mbilesanmi mbilesanmi merged commit 1e90a7a into develop Nov 8, 2018
@mbilesanmi mbilesanmi deleted the feature/161291007/user-profile-update branch November 8, 2018 19:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants