From 1da52b633bc8714e7a97d347071213366e82531a Mon Sep 17 00:00:00 2001 From: Nicola Squartini Date: Thu, 24 Oct 2024 12:31:04 +0200 Subject: [PATCH] fix: keep `group` field in codeHosting --- src/register-fast-onboarding.js | 4 ++-- src/registered.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/register-fast-onboarding.js b/src/register-fast-onboarding.js index 285cee0..40e536b 100644 --- a/src/register-fast-onboarding.js +++ b/src/register-fast-onboarding.js @@ -128,11 +128,11 @@ async function createPublisher(apiURL, pasetoApiToken, pec, amministrazione, ipa async function updateExistingPublisher(apiURL, pasetoApiToken, publisherID, pec, url, codeHosting) { // Clean up the codeHosting array by leaving only the url field of each element. - const cleanCodeHosting = codeHosting.map(({ url })=> ({ url })); + const cleanCodeHosting = codeHosting.map(({ url, group })=> ({ url, group })); const apiPayload = { email: pec, - codeHosting: [ ...cleanCodeHosting, { url } ], + codeHosting: [ ...cleanCodeHosting, { url, group: true } ], }; const res = await fetch(`${apiURL}/publishers/${publisherID}`, { diff --git a/src/registered.js b/src/registered.js index 18d125f..b05dfab 100644 --- a/src/registered.js +++ b/src/registered.js @@ -130,11 +130,11 @@ async function createPublisher(apiURL, pasetoApiToken, pec, amministrazione, ipa async function updateExistingPublisher(apiURL, pasetoApiToken, publisherID, pec, url, codeHosting) { // Clean up the codeHosting array by leaving only the url field of each element. - const cleanCodeHosting = codeHosting.map(({ url })=> ({ url })); + const cleanCodeHosting = codeHosting.map(({ url, group })=> ({ url,group })); const apiPayload = { email: pec, - codeHosting: [ ...cleanCodeHosting, { url } ], + codeHosting: [ ...cleanCodeHosting, { url, group: true } ], }; const res = await fetch(`${apiURL}/publishers/${publisherID}`, {