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

PUT | /users/:userId #28

Open
4 tasks
Israa91 opened this issue Feb 1, 2021 · 0 comments
Open
4 tasks

PUT | /users/:userId #28

Israa91 opened this issue Feb 1, 2021 · 0 comments
Labels

Comments

@Israa91
Copy link
Collaborator

Israa91 commented Feb 1, 2021

relates #5

Route: POST api/v1/signup

Acceptance Criteria

  • Validation
  • DB query
  • Response
  • Testing

Validation

{
 username: yup.string().alphanum().min(5).required(),
 email: yup.string().email().required(),
 password: yup.string().min(8).required(),
 confirmPassword: yup.string().oneOf([yup.ref('password'), null], 'Passwords must match')
}

DB query

UPDATE  users 
SET user_name = user_name,
        email = email,
        password = password
WHERE  user_id=id;

Response

  • Success
{ 
  StatusCode: 200,
  message :"Updated successfully"
}
  • Failed
{
statusCode:401, 
message:"update failed"
}

Testing

to be a successful test

  • status === 200
  • data.length !== 0
@Israa91 Israa91 added the Backend label Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant