From dcc97455973bdc3daba83ceafa4b886e38a77238 Mon Sep 17 00:00:00 2001 From: nicktrn <55853254+nicktrn@users.noreply.github.com> Date: Thu, 2 May 2024 17:13:27 +0100 Subject: [PATCH] fix typecheck --- .../webapp/app/v3/services/createTaskRunAttempt.server.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/webapp/app/v3/services/createTaskRunAttempt.server.ts b/apps/webapp/app/v3/services/createTaskRunAttempt.server.ts index 90ad49273..91dc5ccad 100644 --- a/apps/webapp/app/v3/services/createTaskRunAttempt.server.ts +++ b/apps/webapp/app/v3/services/createTaskRunAttempt.server.ts @@ -16,14 +16,10 @@ export class CreateTaskRunAttemptService extends BaseService { run: TaskRun; attempt: TaskRunAttempt; }> { - let environment: AuthenticatedEnvironment | undefined = env; + const environment = env ?? (await getAuthenticatedEnvironmentFromRun(runId, this._prisma)); if (!environment) { - environment = await getAuthenticatedEnvironmentFromRun(runId, this._prisma); - - if (!environment) { - throw new ServiceValidationError("Environment not found", 404); - } + throw new ServiceValidationError("Environment not found", 404); } const isFriendlyId = runId.startsWith("run_");