feat: make AbstractModuleService create method type-safe (#11216)
This commit is contained in:
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user