Skip to content

Conversation

@eugbyte
Copy link
Owner

@eugbyte eugbyte commented Oct 8, 2025

No description provided.

@eugbyte eugbyte marked this pull request as ready for review October 8, 2025 12:59
@eugbyte eugbyte requested a review from Copilot October 8, 2025 13:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a registration issue by adding null checking for account ID before fetching bookings and restructuring the booking retrieval logic.

Key Changes

  • Added null check for accountId before making booking API calls
  • Moved booking assignment logic outside the API call to handle null account scenarios
  • Changed fallback value for attendeeId from empty string to "-1"

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

let booking: Booking | null = null;
if (accountId != null && accountId.trim().length > 0) {
const { data: bookings } = await getBookings({
attendeeId: accountId ?? "-1",
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Using '-1' as a fallback attendeeId could cause issues if the API doesn't handle this value properly. Consider using a more explicit fallback like null or throwing an error, since the null check above should prevent this case from occurring.

Suggested change
attendeeId: accountId ?? "-1",
attendeeId: accountId,

Copilot uses AI. Check for mistakes.
@eugbyte eugbyte merged commit 0bbcdde into main Oct 8, 2025
2 of 3 checks passed
@eugbyte eugbyte deleted the fix/registration branch October 8, 2025 13:23
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.

2 participants