feat: Refresh invite (#6469)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { MedusaRequest, MedusaResponse } from "../../../../../types/routing"
|
||||
|
||||
import { refreshInviteTokensWorkflow } from "@medusajs/core-flows"
|
||||
|
||||
export const POST = async (req: MedusaRequest, res: MedusaResponse) => {
|
||||
const workflow = refreshInviteTokensWorkflow(req.scope)
|
||||
|
||||
const input = {
|
||||
invite_ids: [req.params.id],
|
||||
}
|
||||
|
||||
const { result: invites } = await workflow.run({ input })
|
||||
|
||||
res.status(200).json({ invite: invites[0] })
|
||||
}
|
||||
Reference in New Issue
Block a user