chore: buyget templates add default target + buy rules (#7500)

* chore: buyget templates add default target + buy rules

* chore: reposition

* chore: address comments

* chore: added fixes

* chore: fix typo

* chore: fix strictness checks
This commit is contained in:
Riqwan Thamir
2024-06-07 09:47:31 +02:00
committed by GitHub
parent bd302e678e
commit 1f1b996f63
23 changed files with 322 additions and 445 deletions
@@ -81,15 +81,23 @@ async function removePromotionRules(
)
}
async function listPromotionRules(id: string | null, ruleType: string) {
async function listPromotionRules(
id: string | null,
ruleType: string,
query?: Record<string, string>
) {
return getRequest<PromotionRuleAttributesListRes>(
`/admin/promotions/${id}/${ruleType}`
`/admin/promotions/${id}/${ruleType}`,
query
)
}
async function listPromotionRuleAttributes(ruleType: string) {
async function listPromotionRuleAttributes(
ruleType: string,
promotionType?: string
) {
return getRequest<PromotionRuleAttributesListRes>(
`/admin/promotions/rule-attribute-options/${ruleType}`
`/admin/promotions/rule-attribute-options/${ruleType}?promotion_type=${promotionType}`
)
}