mirror of
https://github.com/jambonz/jambonz-node.git
synced 2026-07-23 20:42:32 +00:00
another fix to allow 202 response to PUT
This commit is contained in:
@@ -20,7 +20,9 @@ class RestEntity {
|
||||
console.log({sid, opts});
|
||||
const res = await this.put(`Accounts/${this.accountSid}/${this.name}/${sid}`, opts);
|
||||
if (res.statusCode === 404) throw new Error(`${this.name}.update: sid ${sid} not found`);
|
||||
if (res.statusCode !== 204) throw new Error(`${this.name}.update: unexpected status code ${res.statusCode}`);
|
||||
if (![202, 204].includes(res.statusCode)) {
|
||||
throw new Error(`${this.name}.update: unexpected status code ${res.statusCode}`);
|
||||
}
|
||||
}
|
||||
|
||||
async list(opts) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@jambonz/node-client",
|
||||
"version": "0.2.2",
|
||||
"version": "0.2.3",
|
||||
"description": "",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user