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

fix(ScannerModal): hide nasty API errors from user #438

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

AdrianAndersen
Copy link
Member

No description provided.

Copy link

vercel bot commented Jun 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bl-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2024 3:22pm

@AdrianAndersen
Copy link
Member Author

Copy link
Member

@LarsSelbekk LarsSelbekk left a comment

Choose a reason for hiding this comment

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

Umm I think this would prevent "Du har allerede denne boken" etc, which is bad

@AdrianAndersen
Copy link
Member Author

No, that error stems from the

const response = await addWithEndpoint(
        "matches",
        "transfer-item",
        JSON.stringify({ blid: scannedText }),
      );

call. The handleItemsTransferred is only a mutator (getter) that gets the latest changes for the match. Thus, all important match transfer errors will be displayed, while errors stemming from getting the latest version would be supressed.

@AdrianAndersen AdrianAndersen merged commit ad30e74 into main Jun 18, 2024
8 checks passed
@AdrianAndersen AdrianAndersen deleted the hide-api-errors-for-users branch June 18, 2024 17:34
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