fixed deleteOrganisation response

This commit is contained in:
La_Felx
2023-01-02 18:56:12 +01:00
parent 2ee348bac0
commit e3d22c9063
+1 -3
View File
@@ -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);
}; };