From b95e3ac0acf482f5f104d5d1e7bb423f436482ac Mon Sep 17 00:00:00 2001 From: Debora Crescenzo Date: Fri, 12 Sep 2025 14:58:10 +0100 Subject: [PATCH] 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 f34d8e153d24bb3d2af0671a4d6b312204a9ff1e) (cherry picked from commit 0a96afb9643494a08d4454cfd562d3d74f1a3f1a) --- src/api/subscriber.js | 14 +++++++++----- src/store/user.js | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/api/subscriber.js b/src/api/subscriber.js index d5b7cef0..1c8be8d0 100644 --- a/src/api/subscriber.js +++ b/src/api/subscriber.js @@ -107,12 +107,16 @@ export function getNcosLevels (options) { }) } export async function getNcosSet () { - let streams = [] - const res = await httpApi.get('api/v2/ncos/sets/') - if (res.data.total_count > 0) { - streams = getJsonBody(res.data)._embedded['ngcp:ncos/sets'] + try { + let streams = [] + const res = await get({ path: 'api/v2/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) { return await patchRemove({ diff --git a/src/store/user.js b/src/store/user.js index 4470bb76..1b78dc73 100644 --- a/src/store/user.js +++ b/src/store/user.js @@ -611,7 +611,7 @@ export default { async getNcosSetSubscriber () { const ncosSet = [] const list = await getNcosSet() - list.forEach((setNcos) => { + list?.forEach((setNcos) => { ncosSet.push({ label: setNcos.name, value: setNcos.id