From 7cb3addfb9ea7dc8bc4cc5fde83dbb3c84a28e1f Mon Sep 17 00:00:00 2001 From: Debora Crescenzo Date: Fri, 12 Sep 2025 14:32:18 +0100 Subject: [PATCH] MT#59078 Disable Primary Acli Creation Add the query param ?create_primary_acli=false to PATCH /api/numbers/{id} as default behaviour. Change-Id: Ib05602ed7850a19c4a984576fd3645ec158c4b0d --- src/api/common.js | 10 +++++++--- src/api/user.js | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/api/common.js b/src/api/common.js index ae810414..e6c5df0d 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -200,10 +200,14 @@ export async function patch (operation, options) { if (requestConfig.resource !== undefined && requestConfig.resourceId !== undefined) { path = `api/${requestConfig.resource}/${requestConfig.resourceId}` } + + const config = { + headers: requestConfig.headers, + ...(requestConfig.params ? { params: requestConfig.params } : {}) + } + try { - return await httpApi.patch(path, [body], { - headers: requestConfig.headers - }) + return await httpApi.patch(path, [body], config) } catch (err) { handleResponseError(err) } diff --git a/src/api/user.js b/src/api/user.js index edd12128..4d534d85 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -134,7 +134,8 @@ export function assignNumber (numberId, subscriberId) { patchReplace({ path: `api/numbers/${numberId}`, fieldPath: 'subscriber_id', - value: subscriberId + value: subscriberId, + params: { create_primary_acli: false } }).then(() => { resolve() }).catch((err) => {