mirror of
https://github.com/detleph/server.git
synced 2026-09-08 23:44:51 +02:00
fixed deleteOrganisation response
This commit is contained in:
@@ -212,13 +212,11 @@ export const deleteOrganisation = async (req: Request<DeleteOrganisationQueryPar
|
|||||||
try {
|
try {
|
||||||
await prisma.organisation.delete({ where: { pid } });
|
await prisma.organisation.delete({ where: { pid } });
|
||||||
|
|
||||||
res.status(204).end();
|
return res.status(204).send();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof PrismaClientKnownRequestError && e.code === "P2025") {
|
if (e instanceof PrismaClientKnownRequestError && e.code === "P2025") {
|
||||||
throw new NotFoundError("organisation", pid);
|
throw new NotFoundError("organisation", pid);
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.status(500).json(genericError);
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user