mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-10-30 11:24:14 +00:00
fix: ignore messaging_hook in application create/update (#567)
messaging_hook was removed along with smpp (#559), but POST and PUT /Applications still pass the request body straight into the INSERT/UPDATE. Clients that still send messaging_hook (even as null) get a 500: "Unknown column 'messaging_hook' in 'field list'". Drop the field from the request body so older clients keep working. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
df686e42b2
commit
d657a0cb2d
2 files changed
+47
-1
No files matched your search
@@ -150,6 +150,8 @@ router.post('/', async(req, res) => {
|
||||
|
||||
// create webhooks if provided
|
||||
const obj = Object.assign({}, req.body);
|
||||
/* messaging_hook was removed along with smpp (#559); ignore it from older clients */
|
||||
delete obj.messaging_hook;
|
||||
for (const prop of ['call_hook', 'call_status_hook']) {
|
||||
if (obj[prop]) {
|
||||
obj[`${prop}_sid`] = await Webhook.make(obj[prop]);
|
||||
@@ -285,6 +287,8 @@ router.put('/:sid', async(req, res) => {
|
||||
|
||||
// create webhooks if provided
|
||||
const obj = Object.assign({}, req.body);
|
||||
/* messaging_hook was removed along with smpp (#559); ignore it from older clients */
|
||||
delete obj.messaging_hook;
|
||||
for (const prop of ['call_hook', 'call_status_hook']) {
|
||||
if (prop in obj && Object.keys(obj[prop]).length) {
|
||||
if ('webhook_sid' in obj[prop]) {
|
||||
|
||||
Reference in new issue
Block a user