diff --git a/src/controllers/branch/contact-controller.ts b/src/controllers/branch/contact-controller.ts index 479dc5b..ecd4917 100644 --- a/src/controllers/branch/contact-controller.ts +++ b/src/controllers/branch/contact-controller.ts @@ -55,4 +55,10 @@ export class BranchContactController extends Controller { ), }); } + + @Delete("{contactId}") + async deleteBranchContact(@Path() branchId: string, @Path() contactId: string) { + const result = await prisma.branchContact.deleteMany({ where: { id: contactId, branchId } }); + if (result.count <= 0) throw new HttpError(HttpStatus.NOT_FOUND, "Branch cannot be found."); + } }