feat: make AbstractModuleService create method type-safe (#11216)

This commit is contained in:
Harminder Virk
2025-02-03 21:25:01 +05:30
committed by GitHub
parent 6cd8249a2c
commit 016e332e9b
23 changed files with 677 additions and 35 deletions
@@ -574,12 +574,14 @@ export default class PromotionModuleService
sharedContext?: Context
): Promise<PromotionTypes.PromotionDTO>
// @ts-expect-error
async createPromotions(
data: PromotionTypes.CreatePromotionDTO[],
sharedContext?: Context
): Promise<PromotionTypes.PromotionDTO[]>
@InjectManager()
// @ts-expect-error
async createPromotions(
data:
| PromotionTypes.CreatePromotionDTO
@@ -841,12 +843,14 @@ export default class PromotionModuleService
sharedContext?: Context
): Promise<PromotionTypes.PromotionDTO>
// @ts-expect-error
async updatePromotions(
data: PromotionTypes.UpdatePromotionDTO[],
sharedContext?: Context
): Promise<PromotionTypes.PromotionDTO[]>
@InjectManager()
// @ts-expect-error
async updatePromotions(
data:
| PromotionTypes.UpdatePromotionDTO
@@ -1295,18 +1299,20 @@ export default class PromotionModuleService
)
}
// @ts-ignore
// @ts-expect-error
async createCampaigns(
data: PromotionTypes.CreateCampaignDTO,
sharedContext?: Context
): Promise<PromotionTypes.CampaignDTO>
// @ts-expect-error
async createCampaigns(
data: PromotionTypes.CreateCampaignDTO[],
sharedContext?: Context
): Promise<PromotionTypes.CampaignDTO[]>
@InjectManager()
// @ts-expect-error
async createCampaigns(
data: PromotionTypes.CreateCampaignDTO | PromotionTypes.CreateCampaignDTO[],
@MedusaContext() sharedContext: Context = {}
@@ -1404,18 +1410,20 @@ export default class PromotionModuleService
}
}
// @ts-ignore
// @ts-expect-error
async updateCampaigns(
data: PromotionTypes.UpdateCampaignDTO,
sharedContext?: Context
): Promise<PromotionTypes.CampaignDTO>
// @ts-expect-error
async updateCampaigns(
data: PromotionTypes.UpdateCampaignDTO[],
sharedContext?: Context
): Promise<PromotionTypes.CampaignDTO[]>
@InjectManager()
// @ts-expect-error
async updateCampaigns(
data: PromotionTypes.UpdateCampaignDTO | PromotionTypes.UpdateCampaignDTO[],
@MedusaContext() sharedContext: Context = {}