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:
William Bouchard
2025-08-22 16:30:30 -04:00
committed by GitHub
parent 92e3b2b432
commit 486621383a
22 changed files with 474 additions and 331 deletions
@@ -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,
})