Skip to content

Commit

Permalink
fix: keep group field in codeHosting
Browse files Browse the repository at this point in the history
  • Loading branch information
tensor5 committed Oct 24, 2024
1 parent 48dfce9 commit 1da52b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/register-fast-onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`, {
Expand Down
4 changes: 2 additions & 2 deletions src/registered.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`, {
Expand Down

0 comments on commit 1da52b6

Please sign in to comment.