feat(dashboard,core,modules): free shipping promotion in dashboard (#13263)
* feat(dashboard,core,modules): free shipping promotion in dashboard * self-review * adapt for edit to work * changeset * integration tests * across for each * remove only from tests * remove console log * revert to across * update wording for shipping promotions * modify changeset * suggestion frane * fix i18n schema
This commit is contained in:
@@ -21,10 +21,15 @@ export const promotionsQueryKeys = {
|
||||
ruleType: string,
|
||||
query?: HttpTypes.AdminGetPromotionRuleParams
|
||||
) => [PROMOTIONS_QUERY_KEY, id, ruleType, query],
|
||||
listRuleAttributes: (ruleType: string, promotionType?: string) => [
|
||||
listRuleAttributes: (
|
||||
ruleType: string,
|
||||
promotionType?: string,
|
||||
applicationMethodTargetType?: string
|
||||
) => [
|
||||
PROMOTIONS_QUERY_KEY,
|
||||
ruleType,
|
||||
promotionType,
|
||||
applicationMethodTargetType,
|
||||
],
|
||||
listRuleValues: (
|
||||
ruleType: string,
|
||||
@@ -101,6 +106,7 @@ export const usePromotions = (
|
||||
export const usePromotionRuleAttributes = (
|
||||
ruleType: string,
|
||||
promotionType?: string,
|
||||
applicationMethodTargetType?: string,
|
||||
options?: Omit<
|
||||
UseQueryOptions<
|
||||
HttpTypes.AdminRuleAttributeOptionsListResponse,
|
||||
@@ -112,9 +118,17 @@ export const usePromotionRuleAttributes = (
|
||||
>
|
||||
) => {
|
||||
const { data, ...rest } = useQuery({
|
||||
queryKey: promotionsQueryKeys.listRuleAttributes(ruleType, promotionType),
|
||||
queryKey: promotionsQueryKeys.listRuleAttributes(
|
||||
ruleType,
|
||||
promotionType,
|
||||
applicationMethodTargetType
|
||||
),
|
||||
queryFn: async () =>
|
||||
sdk.admin.promotion.listRuleAttributes(ruleType, promotionType),
|
||||
sdk.admin.promotion.listRuleAttributes(
|
||||
ruleType,
|
||||
promotionType,
|
||||
applicationMethodTargetType
|
||||
),
|
||||
...options,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user