From f3ef723269b39ecff566272805c8ad077c45c4ec 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 (cherry picked from commit 7cb3addfb9ea7dc8bc4cc5fde83dbb3c84a28e1f) --- 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 51b90658..d347d496 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -236,10 +236,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 7b5476c7..9bfafe6d 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -123,7 +123,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) => {