giraffe
giraffe copied to clipboard
Clear error message from Check-In API
Fixes: #36 and isuse in Backend #809.
Summary by Sourcery
Improve check-in feedback by handling API responses to display specific success and error notifications and refresh orders accordingly.
Enhancements:
- Show "Check-in successful!" or "Already Checked-in!" notifications based on API response statuses
- Display server-provided error messages on check-in failure or fall back to a generic failure notice
- Refresh order list after handling both success and error responses
Reviewer's Guide
Refactor checkIn method to parse API responses and render targeted notifications for success, redeemed, and error outcomes, while enhancing error handling to display detailed messages.
Sequence diagram for improved check-in API error handling and notifications
sequenceDiagram
actor User
participant UI as EventyaySearchCheckIn.vue
participant API as Check-In API
participant Notification as notificationStore
User->>UI: Initiate check-in (click)
UI->>API: POST /orderpositions/{id}/checkin/
alt API returns status 'ok' or 'redeemed'
API-->>UI: { status: 'ok' | 'redeemed' }
UI->>Notification: addNotification(['Check-in successful!' or 'Already Checked-in!'], 'success')
UI->>UI: searchOrders() (refresh)
else API returns status 'error'
API-->>UI: { status: 'error', message }
UI->>Notification: addNotification([message or 'Check-in failed!'], 'error')
UI->>UI: searchOrders() (refresh)
else API call throws error
API--xUI: Error
alt error.response.data.status == 'error'
UI->>Notification: addNotification([error.response.data.message or 'Check-in failed!'], 'error')
else
UI->>Notification: addNotification(['Check-in failed!'], 'error')
end
end
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Implement explicit API response handling in checkIn |
|
src/components/Eventyay/EventyaySearchCheckIn.vue |
| Enhance catch block to surface detailed errors |
|
src/components/Eventyay/EventyaySearchCheckIn.vue |
Possibly linked issues
- #809: PR adds error handling and notifications for Check-In API responses, addressing the issue.
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Deploy Preview for eventyay-checkin ready!
| Name | Link |
|---|---|
| Latest commit | aac6042463be7d638b44ff9369cf34123cdd48e8 |
| Latest deploy log | https://app.netlify.com/projects/eventyay-checkin/deploys/688a51222235650008cefe37 |
| Deploy Preview | https://deploy-preview-37--eventyay-checkin.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Could you add a screen shot of the notification, also once checked it must be a pop-up that shows the attendee info with buttons to manually print the badge not just a notification.
All seems working well.
https://github.com/user-attachments/assets/c79778d8-1d99-4f59-b4e7-e54d2dae82ac