From c808d39b3f8c3af6ef206d553512ab7183fd440d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Jane=C4=8Dek?= Date: Mon, 16 Dec 2024 16:18:01 +0100 Subject: [PATCH] fix(artifact): update the share token only when the share property changes (#139) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lukáš Janeček Co-authored-by: Lukáš Janeček --- src/artifacts/artifacts.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/artifacts/artifacts.service.ts b/src/artifacts/artifacts.service.ts index f96111f..d5653d8 100644 --- a/src/artifacts/artifacts.service.ts +++ b/src/artifacts/artifacts.service.ts @@ -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();