fix(admin-next, utils, medusa): Handle db errors properly and fix form (#7416)
* fix(admin-next, utils, medusa): Handle db errors properly and fix form * fix(admin-next, utils, medusa): Handle db errors properly and fix form * fix(admin-next, utils, medusa): Handle db errors properly and fix form * fix(admin-next, utils, medusa): Handle db errors properly and fix form
This commit is contained in:
@@ -45,9 +45,15 @@ export const POST = async (
|
||||
input: {
|
||||
invites: [req.validatedBody],
|
||||
},
|
||||
throwOnError: false,
|
||||
}
|
||||
|
||||
const { result, errors } = await workflow.run(input)
|
||||
|
||||
if (errors?.length) {
|
||||
throw errors[0].error
|
||||
}
|
||||
|
||||
const { result } = await workflow.run(input)
|
||||
const invite = await refetchInvite(
|
||||
result[0].id,
|
||||
req.scope,
|
||||
|
||||
Reference in New Issue
Block a user