mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-07-04 19:21:53 +00:00
valid if object exists
This commit is contained in:
@@ -103,13 +103,13 @@ async function validateUpdate(req, sid) {
|
||||
}
|
||||
|
||||
let urlError;
|
||||
if (req.body.call_hook.url) {
|
||||
if (req.body.call_hook) {
|
||||
urlError = await isInvalidUrl(req.body.call_hook.url);
|
||||
if (urlError) {
|
||||
throw new DbErrorBadRequest(`call_hook ${urlError}`);
|
||||
}
|
||||
}
|
||||
if (req.body.call_status_hook.url) {
|
||||
if (req.body.call_status_hook) {
|
||||
urlError = await isInvalidUrl(req.body.call_status_hook.url);
|
||||
if (urlError) {
|
||||
throw new DbErrorBadRequest(`call_status_hook ${urlError}`);
|
||||
|
||||
Reference in New Issue
Block a user