mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2025-12-19 05:47:46 +00:00
Should not allow create phone_number on different voip_carrier and account (#394)
* shouldnt create phonenumber on different carrier and account * wip
This commit is contained in:
@@ -40,6 +40,10 @@ async function validateAdd(req) {
|
||||
if (!result || result.length === 0) {
|
||||
throw new DbErrorBadRequest(`voip_carrier not found for sid ${req.body.voip_carrier_sid}`);
|
||||
}
|
||||
const carrier = result[0];
|
||||
if (carrier.account_sid && req.body.account_sid && req.body.account_sid !== carrier.account_sid) {
|
||||
throw new DbErrorBadRequest('voip_carrier_sid does not belong to the account');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user