fix: make v2 with modules run (#6636)

This commit is contained in:
Sebastian Rindom
2024-03-09 15:09:06 +00:00
committed by GitHub
parent c2d56ca12b
commit a838ebae1b
10 changed files with 43 additions and 39 deletions
@@ -61,12 +61,10 @@ export const DELETE = async (
res: MedusaResponse
) => {
const id = req.params.id
const manager = req.scope.resolve("manager")
const deleteCampaigns = deleteCampaignsWorkflow(req.scope)
const { errors } = await deleteCampaigns.run({
input: { ids: [id] },
context: { manager },
throwOnError: false,
})
@@ -10,7 +10,6 @@ import {
import { AdminPostPromotionsPromotionReq } from "../validators"
import { IPromotionModuleService } from "@medusajs/types"
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
import { UpdateApplicationMethodDTO } from "@medusajs/types"
import { UpdatePromotionDTO } from "@medusajs/types"
export const GET = async (
@@ -58,12 +57,10 @@ export const DELETE = async (
res: MedusaResponse
) => {
const id = req.params.id
const manager = req.scope.resolve("manager")
const deletePromotions = deletePromotionsWorkflow(req.scope)
const { errors } = await deletePromotions.run({
input: { ids: [id] },
context: { manager },
throwOnError: false,
})