feat(dashboard): add campaign create to promotion UI (#7306)
* chore(medusa): strict zod versions in workspace * feat(dashboard): add campaign create to promotion UI * chore: fix bug with form reset * chore: address reviews
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
PromotionRulesListRes,
|
||||
PromotionRuleValuesListRes,
|
||||
} from "../../types/api-responses"
|
||||
import { campaignsQueryKeys } from "./campaigns"
|
||||
|
||||
const PROMOTIONS_QUERY_KEY = "promotions" as const
|
||||
export const promotionsQueryKeys = {
|
||||
@@ -185,6 +186,7 @@ export const useCreatePromotion = (
|
||||
mutationFn: (payload) => client.promotions.create(payload),
|
||||
onSuccess: (data, variables, context) => {
|
||||
queryClient.invalidateQueries({ queryKey: promotionsQueryKeys.lists() })
|
||||
queryClient.invalidateQueries({ queryKey: campaignsQueryKeys.lists() })
|
||||
options?.onSuccess?.(data, variables, context)
|
||||
},
|
||||
...options,
|
||||
|
||||
Reference in New Issue
Block a user