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

GET | Get Alumnus Projects #138

Closed
3 tasks
Mu7ammadAbed opened this issue Jun 8, 2020 · 0 comments · Fixed by #140
Closed
3 tasks

GET | Get Alumnus Projects #138

Mu7ammadAbed opened this issue Jun 8, 2020 · 0 comments · Fixed by #140
Assignees

Comments

@Mu7ammadAbed
Copy link
Member

Mu7ammadAbed commented Jun 8, 2020

Route: GET api/v1/alumni/:studentId/projects

Acceptance Criteria

  • DB query

  • Response

  • Testing


DB query
 SELECT * FROM project INNER JOIN student_project ON project.id = student_project.student_id WHERE student_id = id;

Response
  • Success
{ StatusCode: 200,
  data: [{
          id,
          name,
          description,
          img_url,
          githubLink,
          website_link,
          project_type,
          cohortId,
          studentId
        }]
}
  • Failed
{statusCode:400, message:"Invalid"}
Testing

Successful test if

  • statusCode === 200

#5

@Mu7ammadAbed Mu7ammadAbed self-assigned this Jun 8, 2020
Mu7ammadAbed added a commit that referenced this issue Jun 8, 2020
…rpose I wrote a database query which inner join studnt_project table with project table and send the data from project table, after that I created a function which will handle the route /alumni/:studentId/projects and check the params if every thing is right it will send projects data as a json, if there's something wrong with the inputs a proper response message will be send.

After that I do some tests for the function and I achieve 100% test coverage
Relates #138
@Mu7ammadAbed Mu7ammadAbed linked a pull request Jun 8, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants