feat: delete branch contact endpoint
This commit is contained in:
parent
5aded1d215
commit
712a0952dd
1 changed files with 6 additions and 0 deletions
|
|
@ -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.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue