fix: check if body contains customer branch

This commit is contained in:
Methapon2001 2024-12-26 10:23:05 +07:00
parent 5aa5e55f99
commit ff858aaf50

View file

@ -631,7 +631,11 @@ export class QuotationController extends Controller {
}
await permissionCheckCompany(req.user, record.customerBranch.customer.registeredBranch);
if (customerBranch && record.customerBranchId !== body.customerBranchId) {
if (
customerBranch &&
body.customerBranchId &&
record.customerBranchId !== body.customerBranchId
) {
await permissionCheckCompany(req.user, customerBranch.customer.registeredBranch);
}