MT#63561 Fix crash on PBX seat page due to unauthorized error

The PBX seat page was crashing because v2 calls always return
unauthorized. An investigation is ongoing to determine whether
NCOS seat should be accessed by subscriber. In the meantime,
errors are handled gracefully so the user can continue using
the app.

Change-Id: Ie4ce6c7970815b448f406bb5e64aeefda348aeed
(cherry picked from commit f34d8e153d)
mr13.5
Debora Crescenzo 9 months ago committed by Crescenzo Debora
parent d0ebb56e84
commit f0cfb99365

@ -107,12 +107,16 @@ export function getNcosLevels (options) {
}) })
} }
export async function getNcosSet () { export async function getNcosSet () {
let streams = [] try {
const res = await httpApi.get('api/v2/ncos/sets/') let streams = []
if (res.data.total_count > 0) { const res = await get({ path: 'api/v2/ncos/sets/' })
streams = getJsonBody(res.data)._embedded['ngcp:ncos/sets'] if (res?.data?.total_count > 0) {
streams = getJsonBody(res.data)._embedded['ngcp:ncos/sets']
}
return streams
} catch (err) {
return []
} }
return streams
} }
export async function removePreference (id, field) { export async function removePreference (id, field) {
return await patchRemove({ return await patchRemove({

@ -631,7 +631,7 @@ export default {
async getNcosSetSubscriber () { async getNcosSetSubscriber () {
const ncosSet = [] const ncosSet = []
const list = await getNcosSet() const list = await getNcosSet()
list.forEach((setNcos) => { list?.forEach((setNcos) => {
ncosSet.push({ ncosSet.push({
label: setNcos.name, label: setNcos.name,
value: setNcos.id value: setNcos.id

Loading…
Cancel
Save