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

refactor(feedback-api): duplicate adminform feedback endpoints for /api/v3 #1589

Merged
merged 6 commits into from
Apr 13, 2021

Conversation

orbitalsqwib
Copy link
Contributor

@orbitalsqwib orbitalsqwib commented Apr 8, 2021

Problem

Update current adminform feedback endpoints to their /api rooted endpoints to follow a RESTful hierarchy.

Closes #1508

Solution

Features:

  • shard admin routes into separate files
  • duplicate adminform feedback endpoint functionalities and integration tests with the new api v3 routes
  • update frontend api calls to use new endpoints

Tests

  • Create a new form, submit a new response, then submit feedback for the form
  • Return to the form admin feedback section
  • Check that the feedback can be successfully retrieved (GET /api/v3/admin/forms/:formId/feedback returns 200)
  • Check that the form feedback count is correct (GET /api/v3/admin/forms/:formId/feedback/count returns 200)
  • Check that the feedback export function works (GET /api/v3/admin/forms/:formId/feedback/download returns 200)
  • Check that calling GET /api/v3/admin/forms/:formId/feedback without logging in results in a 401 Unauthorized error
  • Check that calling PATCH /api/v3/admin/forms/:formId/settings without logging in results in a 401 Unauthorized error

… /api/v3 router

- duplicate adminform feedback endpoint functionalities and update them to use the
new api v3 routes
- update v3 router to use new endpoints
- update frontend api calls to use new endpoints
@orbitalsqwib orbitalsqwib requested review from karrui and seaerchin April 8, 2021 06:49
- remove duplicated auth middleware from feedback endpoints
- import index level router for form-route tests to account for
shifted auth middleware
- shard index into admin-forms.routes and index to follow convention
@orbitalsqwib orbitalsqwib requested a review from karrui April 9, 2021 07:51
@orbitalsqwib orbitalsqwib requested a review from karrui April 12, 2021 03:33
@karrui
Copy link
Contributor

karrui commented Apr 12, 2021

Feedback is an uncountable noun, sorry for the fail

Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

lgtm

@orbitalsqwib orbitalsqwib requested a review from karrui April 13, 2021 05:10
@orbitalsqwib orbitalsqwib merged commit f876c43 into develop Apr 13, 2021
@orbitalsqwib orbitalsqwib deleted the ref/feedback-api branch April 13, 2021 05:29
@tshuli tshuli mentioned this pull request Apr 20, 2021
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.

[API] Duplicate admin's form feedback related endpoints to their new /api counterparts
3 participants