-
Notifications
You must be signed in to change notification settings - Fork 2
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
#167484590: create user profiles upon successful registration #18
Conversation
@@ -0,0 +1,17 @@ | |||
import model from '../sequelize/models'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
src/controllers/profile.js
Outdated
@@ -0,0 +1,110 @@ | |||
import { config } from 'dotenv'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
src/config/passport/passport.js
Outdated
@@ -0,0 +1,48 @@ | |||
import passport from 'passport'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
src/controllers/profile.js
Outdated
import { User } from '../sequelize/models'; | ||
|
||
config(); | ||
cloudinary.config({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cloudinary config would be better if you put it in config folder. And rename the name of this controller to profileController
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on it. thanks
src/middleware/editProfile.js
Outdated
|
||
if (trueUsername !== suggestedUsername) { | ||
return res.status(403).send({ | ||
error: 'sorry! you can not edit the profile that is not yours' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this error message. I think it'd be better if the message started with a capital letter and instead of can not
, cannot
would be a better option in this case Reference to this article
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on it. thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have noticed that actually, you can upload a picture twice. Well, that is disastrous for our account because we are using a limited subscription. If you could make sure that when the user uploads a picture, it checks if the picture already exists. if so, it just uses the uploaded one.
yes, you are right. let me implement that. thanks |
src/controllers/profile.js
Outdated
cloud_name: process.env.cloudinaryName, | ||
api_key: process.env.cloudinaryApiKey, | ||
api_secret: process.env.cloudinarySecretKey, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You should use the same route parameter name for consistency. You should use the one in lower case: username.
- You should capitalize the variable name: userfound as userFound because it is made up with 2 words.
- I think you should protect the route for retrieving a user profile because I was able to retrieve the route without having logged in.
- I think you should remove the status as we agreed. This error message got triggered when I tried to update my profile.
- You should remove those purple characters for the error message to be easily read.
@@ -0,0 +1,110 @@ | |||
import { config } from 'dotenv'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
74ac92d
to
301d266
Compare
301d266
to
45b5bd1
Compare
45b5bd1
to
1b8176f
Compare
@placideirandora I talked to TTL about this. and we agreed to make a chore of doing that |
Ok. It is because when I received the feedback about email confirmation link, I asked if I could modify other's methods for me to be able to implement the feedback and he told that I could do that. For me, I removed them already. So, That chore will be only for removing that one that I have mentioned for you to remove. A chore to remove one status message. |
1b8176f
to
ab19b45
Compare
ab19b45
to
bdf4fbe
Compare
bdf4fbe
to
c54cfb1
Compare
What does this PR do?
It implements:
Description of Task to be done?
How should this be manually tested?
npm install
localhost:3000/api/v1/users
usingPOST
method.4.- add this env variable for cloudinary into your dotenv
localhost:3000/api/v1/profile/username
usingPUT
method.using formdata you can update the following information with this example:
What are the relevant pivotal tracker stories?
create user profiles upon successful registration
screen shots