feat(tax): add support for updating tax rates (#6537)
This commit is contained in:
@@ -196,6 +196,27 @@ export default class TaxModuleService<
|
||||
return await this.taxRateService_.update({ selector, data }, sharedContext)
|
||||
}
|
||||
|
||||
async upsert(
|
||||
data: TaxTypes.UpsertTaxRateDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<TaxTypes.TaxRateDTO[]>
|
||||
async upsert(
|
||||
data: TaxTypes.UpsertTaxRateDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<TaxTypes.TaxRateDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
async upsert(
|
||||
data: TaxTypes.UpsertTaxRateDTO | TaxTypes.UpsertTaxRateDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
): Promise<TaxTypes.TaxRateDTO | TaxTypes.TaxRateDTO[]> {
|
||||
const result = await this.taxRateService_.upsert(data, sharedContext)
|
||||
const serialized = await this.baseRepository_.serialize<
|
||||
TaxTypes.TaxRateDTO[]
|
||||
>(result, { populate: true })
|
||||
return Array.isArray(data) ? serialized : serialized[0]
|
||||
}
|
||||
|
||||
createTaxRegions(
|
||||
data: TaxTypes.CreateTaxRegionDTO,
|
||||
sharedContext?: Context
|
||||
|
||||
Reference in New Issue
Block a user