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 /alumni/:id | Route #25

Closed
5 tasks done
AlaaSaadeddin opened this issue Mar 26, 2020 · 0 comments
Closed
5 tasks done

PUT /alumni/:id | Route #25

AlaaSaadeddin opened this issue Mar 26, 2020 · 0 comments
Assignees

Comments

@AlaaSaadeddin
Copy link
Collaborator

AlaaSaadeddin commented Mar 26, 2020

Route: PUT api/v1/alumni/:studentId

Acceptance Criteria

  • Validation Schema

  • DB query

  • Request body

  • Response

  • Testing


Validation schema
let addStudent = yup.object({
  name: yup.string().required(),
  githubUsername: yup.string().required(),
  githubLink: yup.string().required(),
  image: yup.string().required(),
});

DB query
   UPDATE student SET (name = req.body.name, githubUsername = req.body.githubUsername,  githubLink = req.body.githubLink, image = req.body.image) WHERE id = studentId;

Request body
 req.body = {
      name,
      githubUsername,
      githubLink,
      image,
      cohortId
}

Response
  • Success
{ statusCode: 200 ,message:"Edited successfully"}
  • Failed
{statusCode:400, message:"Invalid data"}
Testing

Successful test if

  • statusCode === 200

#5

rehabas added a commit that referenced this issue Apr 2, 2020
rehabas added a commit that referenced this issue Apr 2, 2020
rehabas added a commit that referenced this issue Apr 2, 2020
rehabas added a commit that referenced this issue Apr 2, 2020
rehabas added a commit that referenced this issue Apr 2, 2020
@rehabas rehabas added Awaiting Review This PR is ready and waiting for review and removed To-Do labels Apr 2, 2020
rehabas added a commit that referenced this issue Apr 2, 2020
rehabas added a commit that referenced this issue Apr 2, 2020
rehabas added a commit that referenced this issue Apr 2, 2020
rehabas added a commit that referenced this issue Apr 2, 2020
Mu7ammadAbed pushed a commit that referenced this issue Apr 3, 2020
@ranasobeid95 ranasobeid95 added Done and removed Awaiting Review This PR is ready and waiting for review labels Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants