feat(dashboard,types,promotion,medusa): hide fields on promotions depending on templates (#7746)
**what:** - hides different fields depending on the chosen template - remove operator values API - fixes to edit promotion rules - make currency optional for promotion RESOLVES CORE-2297
This commit is contained in:
@@ -2,7 +2,6 @@ import { AdminGetPromotionsParams } from "@medusajs/medusa"
|
||||
import {
|
||||
AdminPromotionRuleListResponse,
|
||||
AdminRuleAttributeOptionsListResponse,
|
||||
AdminRuleOperatorOptionsListResponse,
|
||||
AdminRuleValueOptionsListResponse,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
@@ -49,7 +48,6 @@ export const promotionsQueryKeys = {
|
||||
ruleValue,
|
||||
query,
|
||||
],
|
||||
listRuleOperators: () => [PROMOTIONS_QUERY_KEY],
|
||||
}
|
||||
|
||||
export const usePromotion = (
|
||||
@@ -107,26 +105,6 @@ export const usePromotions = (
|
||||
return { ...data, ...rest }
|
||||
}
|
||||
|
||||
export const usePromotionRuleOperators = (
|
||||
options?: Omit<
|
||||
UseQueryOptions<
|
||||
AdminRuleOperatorOptionsListResponse,
|
||||
Error,
|
||||
AdminRuleOperatorOptionsListResponse,
|
||||
QueryKey
|
||||
>,
|
||||
"queryFn" | "queryKey"
|
||||
>
|
||||
) => {
|
||||
const { data, ...rest } = useQuery({
|
||||
queryKey: promotionsQueryKeys.listRuleOperators(),
|
||||
queryFn: async () => client.promotions.listRuleOperators(),
|
||||
...options,
|
||||
})
|
||||
|
||||
return { ...data, ...rest }
|
||||
}
|
||||
|
||||
export const usePromotionRuleAttributes = (
|
||||
ruleType: string,
|
||||
promotionType?: string,
|
||||
|
||||
Reference in New Issue
Block a user