From 76882d78354e17035e0d17d020cabfda517a77a6 Mon Sep 17 00:00:00 2001 From: Nicola Squartini Date: Mon, 21 Oct 2024 18:11:16 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20`Array.push()`=20doesn=E2=80=99t=20retur?= =?UTF-8?q?n=20an=20array?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/register-fast-onboarding.js | 4 +--- src/registered.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/register-fast-onboarding.js b/src/register-fast-onboarding.js index 8fcf37f..1dffbcd 100644 --- a/src/register-fast-onboarding.js +++ b/src/register-fast-onboarding.js @@ -129,9 +129,7 @@ async function createPublisher(apiURL, pasetoApiToken, pec, amministrazione, ipa async function updateExistingPublisher(apiURL, pasetoApiToken, publisherID, pec, url, codeHosting) { const apiPayload = { email: pec, - codeHosting: codeHosting.push({ - url: url - }), + codeHosting: [ ...codeHosting, { url } ], }; const res = await fetch(`${apiURL}/publishers/${publisherID}`, { diff --git a/src/registered.js b/src/registered.js index 6d1b73d..1edd731 100644 --- a/src/registered.js +++ b/src/registered.js @@ -131,9 +131,7 @@ async function createPublisher(apiURL, pasetoApiToken, pec, amministrazione, ipa async function updateExistingPublisher(apiURL, pasetoApiToken, publisherID, pec, url, codeHosting) { const apiPayload = { email: pec, - codeHosting: codeHosting.push({ - url: url - }), + codeHosting: [ ...codeHosting, { url } ], }; const res = await fetch(`${apiURL}/publishers/${publisherID}`, {