Skip to content

Commit

Permalink
Fix: assigned category in voucher details is not visible (#4709)
Browse files Browse the repository at this point in the history
* Refetch when catalog add and delete

* Add changeset

* Update changeset
  • Loading branch information
poulch committed Mar 11, 2024
1 parent a98053b commit 5592f67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-toys-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Fix: assigned category in voucher details is not visible
5 changes: 4 additions & 1 deletion src/discounts/views/VoucherDetails/VoucherDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const VoucherDetails: React.FC<VoucherDetailsProps> = ({
includeProducts: activeTab === VoucherDetailsPageTab.products,
};

const { data, loading } = useVoucherDetailsQuery({
const { data, loading, refetch } = useVoucherDetailsQuery({
displayLoader: true,
variables: {
id,
Expand Down Expand Up @@ -224,6 +224,7 @@ export const VoucherDetails: React.FC<VoucherDetailsProps> = ({
notifySaved();
closeModal();
reset();
refetch();
}
},
});
Expand All @@ -234,6 +235,8 @@ export const VoucherDetails: React.FC<VoucherDetailsProps> = ({
if (data.voucherCataloguesAdd.errors.length === 0) {
notifySaved();
closeModal();
reset();
refetch();
}
},
});
Expand Down

0 comments on commit 5592f67

Please sign in to comment.