mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
Merge main branch updates
This commit is contained in:
@@ -221,7 +221,14 @@ export default function PromoDiscountBadge() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const deactivateMutation = useMutation({
|
const deactivateMutation = useMutation({
|
||||||
mutationFn: promoApi.deactivateDiscount,
|
mutationFn: async () => {
|
||||||
|
const source = activeDiscount?.source;
|
||||||
|
if (source && source.startsWith('promocode:')) {
|
||||||
|
await promoApi.deactivateDiscount();
|
||||||
|
} else {
|
||||||
|
await promoApi.clearActiveDiscount();
|
||||||
|
}
|
||||||
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
queryClient.invalidateQueries({ queryKey: ['active-discount'] });
|
queryClient.invalidateQueries({ queryKey: ['active-discount'] });
|
||||||
queryClient.invalidateQueries({ queryKey: ['promo-offers'] });
|
queryClient.invalidateQueries({ queryKey: ['promo-offers'] });
|
||||||
|
|||||||
Reference in New Issue
Block a user