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

POST /alumni | Route #13

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

POST /alumni | Route #13

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

Comments

@AlaaSaadeddin
Copy link
Collaborator

AlaaSaadeddin commented Mar 26, 2020

Route: POST api/v1/alumni

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
   INSERT INTO student (name, githubUsername, githubLink,image) VALUES (req.body.name, req.body.githubUsername, req.body.githubLink,req.body.image);

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

Response
  • Success
{ statusCode: 200 ,data : {studentId,message:"Added successfully"}}
  • Failed
{statusCode:400, message:"Failed to add"}
Testing

Successful test if

  • statusCode === 200

#5

@AlaaSaadeddin AlaaSaadeddin changed the title Add new student Add new student | Route Mar 26, 2020
@AlaaSaadeddin AlaaSaadeddin changed the title Add new student | Route Post /alumni | Route Mar 26, 2020
@AlaaSaadeddin AlaaSaadeddin changed the title Post /alumni | Route POST /alumni | Route Mar 26, 2020
AlaaSaadeddin pushed a commit that referenced this issue Apr 4, 2020
AlaaSaadeddin pushed a commit that referenced this issue Apr 4, 2020
AlaaSaadeddin pushed a commit that referenced this issue Apr 4, 2020
@AlaaSaadeddin AlaaSaadeddin added Awaiting Review This PR is ready and waiting for review and removed in progress labels Apr 4, 2020
AlaaSaadeddin pushed a commit that referenced this issue Apr 4, 2020
AlaaSaadeddin pushed a commit that referenced this issue Apr 4, 2020
AlaaSaadeddin pushed a commit that referenced this issue Apr 5, 2020
@ranasobeid95 ranasobeid95 added Done and removed Awaiting Review This PR is ready and waiting for review labels Jun 8, 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

2 participants