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

Edit Unavailability Endpoint #206

Merged
merged 3 commits into from
Apr 7, 2024

Conversation

TaiHaDev
Copy link
Contributor

@TaiHaDev TaiHaDev commented Apr 5, 2024

Describe your changes

The logic for updating unavailability is simple. Updating any field in the unavailability with the matching fields in the payload. The most important part is the payload validation, the payload data is checked in the repository function and raise custom errors to catch later in the controller. Some features:

  • a user can only edit their own unavailability (this feature will be later discussed within the meeting to see if it should be applied for other API endpoints)
  • custom errors (EventNotFoundError, InvalidArgumentError)

Issue ticket number and link

Copy link
Collaborator

@emilymclean emilymclean left a comment

Choose a reason for hiding this comment

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

Good work! Just looking for some explanation about the choice to move the is_user_or_has_role check before approval.

controllers/v2/unavailability/api.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@emilymclean emilymclean left a comment

Choose a reason for hiding this comment

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

Good job!

@naychithanshwe naychithanshwe added this pull request to the merge queue Apr 7, 2024
Merged via the queue into main with commit b3d7951 Apr 7, 2024
6 checks passed
@naychithanshwe naychithanshwe deleted the johnha/feature/edit-unavailability-endpoint branch April 7, 2024 07:15
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.

3 participants