Skip to content

changed endpoint for getting al hightlights. Status code is now 200 w… #248

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

Merged
merged 12 commits into from
Oct 9, 2020

Conversation

niraymak
Copy link
Member

…hen the list is emtpy.

Description

A few sentences describing the overall goals of the pull request's commits.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I did not update API Controllers, if I did, I added/changed Postman tests
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I updated the changelog with an end-user readable description
  • I assigned this pull request to the correct project board to update the sprint board

Steps to Test or Reproduce

  1. Make sure there are no highlights in the database
  2. Do a GET request to /api/Highlights (with right credentials)
  3. Check if you receive an empty array with status code 200.

Link to issue

Closes: #207

@Brend-Smits
Copy link
Member

Hey @niraymak are there other endpoints from other controllers that will also need changing? I wonder if this is the only endpoint with this issue.

@niraymak
Copy link
Member Author

Hey @niraymak are there other endpoints from other controllers that will also need changing? I wonder if this is the only endpoint with this issue.

Following endpoint should be changed:

  • GetAllEmbeddedProjects also sends 404.
  • GetAllRoles sends 404 if list.count == 0.
  • GetAllPossibleScopes sends 404 if list.count == 0.

Shall I change them and push them to this PR?

@niraymak
Copy link
Member Author

Hey @niraymak are there other endpoints from other controllers that will also need changing? I wonder if this is the only endpoint with this issue.

Following endpoint should be changed:

  • GetAllEmbeddedProjects also sends 404.
  • GetAllRoles sends 404 if list.count == 0.
  • GetAllPossibleScopes sends 404 if list.count == 0.

Shall I change them and push them to this PR?

Changed the endpoints and pushed them to the PR

@Brend-Smits
Copy link
Member

Awesome, thanks @niraymak. Please also change the postman tests ^^'

@niraymak
Copy link
Member Author

@Brend-Smits test results are 100%. The corresponding tests already check for status code 200. I am not sure what to update in the Postman tests. Can you tell me what tests I should add?

@Brend-Smits
Copy link
Member

@Brend-Smits test results are 100%. The corresponding tests already check for status code 200. I am not sure what to update in the Postman tests. Can you tell me what tests I should add?

Ah right, we don't have any tests for checking status codes when there are no entries. That's fine.

Copy link
Member

@Brend-Smits Brend-Smits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove try-catch as discussed in Teams and we're good to go.

@niraymak niraymak requested a review from Brend-Smits October 6, 2020 13:46
@Brend-Smits
Copy link
Member

Since #240 is now merged, make sure the documentation is updated!

@Brend-Smits Brend-Smits self-requested a review October 8, 2020 13:12
@Brend-Smits Brend-Smits merged commit 27258d7 into develop Oct 9, 2020
@Brend-Smits Brend-Smits deleted the bugfix/207-highlight-status-code branch October 9, 2020 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Status code 404 should not be used for empty lists
2 participants