boolean-uk / team-dev-server

3 stars 12 forks source link

As a user, so that other users know what I look like, I want to add a profile picture #38 #220

Open CoderManSam opened 2 years ago

CoderManSam commented 2 years ago

-On register createProfile POST request will accept a JSON body from frontend which will now include an optional progileImageUrl string, if no string is in the body the default profile image will be used, otherwise the provided image url will be used to add to the db.

-create editProfile PUT request which will accept a JSON body from frontend which will update the profile's information. Will check the token is valid before going ahead using jwt.verify to ensure the user should be able to update their information. JSON body will be: {profileImageUrl: 'string'}

-upon login frontend will request the users profile information, backend will make a GET request obtaining the users profile information from the db and returning it to frontend to populate the profile with (including the profileImageUrl string to be used to populate the profile image.

-when a post is created it'll have the users id, upon creation a GET request can be made using that id to get the users profileImageUrl by going to /profile:id, frontend can then populate the profile image in the post using that url.

JWTwebtoken package required.

vherus commented 2 years ago

-when a post is created it'll have the users id, upon creation a GET request can be made using that id to get the users profileImageUrl by going to /profile:id, frontend can then populate the profile image in the post using that url.

I think you'll be able to include the users information in the response you get from the POST when creating the post, so you should be able to avoid making another GET for the profile image.

LGTM!