fix: Update auth app_metadata when deleting users + customers (#9041)
* wip * more work * working on stuff * more * fix test * remove incorrect test * fix test * fix: Only allow deletion of yourself * remove redundant tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
deleteCustomersWorkflow,
|
||||
removeCustomerAccountWorkflow,
|
||||
updateCustomersWorkflow,
|
||||
} from "@medusajs/core-flows"
|
||||
import { AdditionalData, HttpTypes } from "@medusajs/types"
|
||||
@@ -68,10 +68,11 @@ export const DELETE = async (
|
||||
res: MedusaResponse<HttpTypes.AdminCustomerDeleteResponse>
|
||||
) => {
|
||||
const id = req.params.id
|
||||
const deleteCustomers = deleteCustomersWorkflow(req.scope)
|
||||
|
||||
await deleteCustomers.run({
|
||||
input: { ids: [id] },
|
||||
await removeCustomerAccountWorkflow(req.scope).run({
|
||||
input: {
|
||||
customerId: id,
|
||||
},
|
||||
})
|
||||
|
||||
res.status(200).json({
|
||||
|
||||
Reference in New Issue
Block a user