-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add POST guests endpoint #76
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
base: main
Are you sure you want to change the base?
Conversation
Dao-Ho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one smol cmt to throw a specific conflict error on inserts, otherwise LGTM 🔥
| var pgErr *pgconn.PgError | ||
| if errors.As(err, &pgErr) { | ||
| if pgErr.Code == "23505" { | ||
| return nil, errors.New("guest already exists") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I should've clarifiedm we have a errs/repository.go for defining already exists constants.
You can specify the err message in the handler and throw a http error once you catch this repository error. Lmk if this make sense
Dao-Ho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more 🙏
Description
Added POST endpoint for guests as a part of the whole guest entity integration (#68)
Type of Change
Related Issue(s)
Addresses part of (#68)
What Changed?
POST /api/v1/guestsendpoint for guest creationTesting & Validation
How this was tested
Screenshots/Recordings
Unfinished Work & Known Issues
Notes & Nuances
Pre-Merge Checklist
Code Quality
Testing & CI
Documentation
Reviewer Notes