Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

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.

@AdrianAndersen AdrianAndersen self-assigned this Jun 17, 2024
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
Contributor

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants