From 7be47354e1eb95141f420ef9c74f98b3e2bd8315 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Fri, 17 Jan 2025 11:22:10 +0200 Subject: [PATCH] fix(core-flows,medusa): use deleteRefundReasonsWorkflow in delete /admin/refund-reasons/:id (#11012) --- .changeset/five-candles-dress.md | 6 ++++++ .../core-flows/src/payment-collection/workflows/index.ts | 1 + packages/medusa/src/api/admin/refund-reasons/[id]/route.ts | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/five-candles-dress.md diff --git a/.changeset/five-candles-dress.md b/.changeset/five-candles-dress.md new file mode 100644 index 0000000000..b35220b75f --- /dev/null +++ b/.changeset/five-candles-dress.md @@ -0,0 +1,6 @@ +--- +"@medusajs/core-flows": patch +"@medusajs/medusa": patch +--- + +fix(core-flows,medusa): use deleteRefundReasonsWorkflow in delete /admin/refund-reasons/:id diff --git a/packages/core/core-flows/src/payment-collection/workflows/index.ts b/packages/core/core-flows/src/payment-collection/workflows/index.ts index 1baf16420a..f8bbbf5d0d 100644 --- a/packages/core/core-flows/src/payment-collection/workflows/index.ts +++ b/packages/core/core-flows/src/payment-collection/workflows/index.ts @@ -2,3 +2,4 @@ export * from "./create-payment-session" export * from "./create-refund-reasons" export * from "./delete-payment-sessions" export * from "./update-refund-reasons" +export * from "./delete-refund-reasons" \ No newline at end of file diff --git a/packages/medusa/src/api/admin/refund-reasons/[id]/route.ts b/packages/medusa/src/api/admin/refund-reasons/[id]/route.ts index c2fd17b544..4f32700992 100644 --- a/packages/medusa/src/api/admin/refund-reasons/[id]/route.ts +++ b/packages/medusa/src/api/admin/refund-reasons/[id]/route.ts @@ -1,5 +1,5 @@ import { - deleteReturnReasonsWorkflow, + deleteRefundReasonsWorkflow, updateRefundReasonsWorkflow, } from "@medusajs/core-flows" import { HttpTypes, RefundReasonResponse } from "@medusajs/framework/types" @@ -56,7 +56,7 @@ export const DELETE = async ( const { id } = req.params const input = { ids: [id] } - await deleteReturnReasonsWorkflow(req.scope).run({ input }) + await deleteRefundReasonsWorkflow(req.scope).run({ input }) res.json({ id,