Skip to content

Commit

Permalink
fix(artifact): update the share token only when the share property ch…
Browse files Browse the repository at this point in the history
…anges (#139)

Signed-off-by: Lukáš Janeček <lukas.janecek1@ibm.com>
Co-authored-by: Lukáš Janeček <lukas.janecek1@ibm.com>
  • Loading branch information
xjacka and Lukáš Janeček authored Dec 16, 2024
1 parent e00adc7 commit c808d39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/artifacts/artifacts.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ export async function updateArtifact({
}
artifact.sourceCode = getUpdatedValue(source_code, artifact.sourceCode);
}
if (shared === true) {
if (!artifact.accessToken && shared === true) {
artifact.accessToken = getToken();
} else if (shared === false) {
} else if (artifact.accessToken && shared === false) {
artifact.accessToken = undefined;
}
await ORM.em.flush();
Expand Down

0 comments on commit c808d39

Please sign in to comment.