TT#103253 Fix SourceSet creation in CallForwarding due to the new behaviour of the POST endpoint

Change-Id: I1c79da5105eaa24e1c196515eb2820e4e227ea5f
pull/4/head
Hans-Peter Herzog 5 years ago
parent c3a278f992
commit cd736c1fb5

@ -6,6 +6,7 @@ import {
import { import {
v4 v4
} from 'uuid' } from 'uuid'
import _ from 'lodash'
export async function cfLoadMappings (subscriberId) { export async function cfLoadMappings (subscriberId) {
return get({ return get({
@ -72,7 +73,7 @@ export async function cfCreateSourceSet (id, payload) {
source: number source: number
}) })
}) })
return post({ const res = await post({
resource: 'cfsourcesets', resource: 'cfsourcesets',
body: { body: {
name: payload.name, name: payload.name,
@ -82,6 +83,11 @@ export async function cfCreateSourceSet (id, payload) {
mode: payload.mode mode: payload.mode
} }
}) })
if (!_.isString(res)) {
return res.id + ''
} else {
return res
}
} }
export async function cfUpdateSourceSet (id, payload) { export async function cfUpdateSourceSet (id, payload) {

Loading…
Cancel
Save