-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [IOBP-1020] Using optimistic UI for remove payment method acti…
…on (#6446) ## Short description This pull request introduces several changes to include an optimistic UI logic for the handling of deleted wallet cards in the wallet management system ## List of changes proposed in this pull request - Introduced a new `DeletedCard` type and updated the `WalletCardsState` type to include an optional `deletedCard` property. - Added logic to handle the `paymentsDeleteMethodAction` request, cancel, and failure actions, ensuring that deleted cards can be restored if necessary. - Modified the `selectWalletCards` selector to exclude the `deletedCard` from the list of wallet cards. - Removed the call to `walletRemoveCards` and added logic to dispatch a failure action with network error details if the deletion fails ## How to test - Try to remove a payment method with a backend error (_add a delay to the dev-server `addPaymentWalletHandler` delete function with 400 response_) - Check if the deleted method is coming back at its original position ## Preview https://github.com/user-attachments/assets/29120b17-5b40-440b-80d1-1ab0e42a5c97 --------- Co-authored-by: Alessandro <[email protected]>
- Loading branch information
1 parent
b420196
commit 274fa6f
Showing
5 changed files
with
157 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters