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

#2313 implemented route, controller, and services #2391

Closed
wants to merge 4 commits into from

Conversation

bracyw
Copy link
Contributor

@bracyw bracyw commented May 14, 2024

Changes

Created a endpoint for setting the status of a design review. It can be used by the creator of the design review or app admins. Implemented behavior in design-review, routes, controllers, and services files.

Test Cases

  • change with app admin who is not creator
  • set status works when creator is not admin
  • fails when user is not admin or creator
  • doesn't work if a string is input that is not a DR status

tested with postman, results shown below

Screenshots

before change - with app admin:
Valid set status (with app admin who is not creator) - before
after change - with app admin:
Valid set status with app admin (who is not creator) - after

set status works when creator is not admin
Valid set status (creator who is not admin)

invalid when user is not admin or creator
Invalid user set status

invalid status - produces error
Invalid status - error

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (see Screenshots section)
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • No yarn.lock changes (unless dependencies have changed)
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #2313

@bracyw bracyw self-assigned this May 14, 2024
@bracyw bracyw requested a review from RChandler234 May 14, 2024 22:21
Copy link
Contributor

@Peyton-McKee Peyton-McKee left a comment

Choose a reason for hiding this comment

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

nicely done, but we need to write unmocked tests


// verify user is allowed to set the status of the design review
if (!isAdmin(user.role) && user.userId !== originaldesignReview.userCreatedId) {
throw new AccessDeniedMemberException('set the status of a design review');
Copy link
Contributor

Choose a reason for hiding this comment

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

accessdeniedadminonly acception

Copy link
Contributor

Choose a reason for hiding this comment

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

or http exception saying only admins or the creator can do it

@Peyton-McKee Peyton-McKee changed the base branch from develop to feature/multitenancy May 18, 2024 15:37
@Peyton-McKee Peyton-McKee deleted the branch feature/multitenancy May 25, 2024 20:09
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.

DRC Debugs - Set DR Status Endpoint
2 participants