From cd736c1fb5e3b098f75c30858b8be0e453e0f3c5 Mon Sep 17 00:00:00 2001 From: Hans-Peter Herzog Date: Thu, 26 Nov 2020 11:53:34 +0100 Subject: [PATCH] TT#103253 Fix SourceSet creation in CallForwarding due to the new behaviour of the POST endpoint Change-Id: I1c79da5105eaa24e1c196515eb2820e4e227ea5f --- src/api/call-forwarding.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/api/call-forwarding.js b/src/api/call-forwarding.js index 32f638ad..e6a642a2 100644 --- a/src/api/call-forwarding.js +++ b/src/api/call-forwarding.js @@ -6,6 +6,7 @@ import { import { v4 } from 'uuid' +import _ from 'lodash' export async function cfLoadMappings (subscriberId) { return get({ @@ -72,7 +73,7 @@ export async function cfCreateSourceSet (id, payload) { source: number }) }) - return post({ + const res = await post({ resource: 'cfsourcesets', body: { name: payload.name, @@ -82,6 +83,11 @@ export async function cfCreateSourceSet (id, payload) { mode: payload.mode } }) + if (!_.isString(res)) { + return res.id + '' + } else { + return res + } } export async function cfUpdateSourceSet (id, payload) {