From c7d834193fe35abe5e9423bc196e23b9ce49b559 Mon Sep 17 00:00:00 2001 From: Bryan Chu Date: Mon, 23 Dec 2024 13:09:41 -0800 Subject: [PATCH] --- .../app/graphql/getRunByIdV2.server.ts | 22 +++++++++++++------ .../data-portal/app/routes/runs.$id.tsx | 10 ++++----- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/frontend/packages/data-portal/app/graphql/getRunByIdV2.server.ts b/frontend/packages/data-portal/app/graphql/getRunByIdV2.server.ts index ba0977f6f..4480e2e79 100644 --- a/frontend/packages/data-portal/app/graphql/getRunByIdV2.server.ts +++ b/frontend/packages/data-portal/app/graphql/getRunByIdV2.server.ts @@ -422,13 +422,21 @@ function getAnnotationShapesFilter( return where } -export async function getRunByIdV2( - client: ApolloClient, - id: number, - annotationsPage: number, - params: URLSearchParams = new URLSearchParams(), - depositionId?: number, -): Promise> { +export interface GetRunByIdV2Params { + client: ApolloClient + id: number + annotationsPage: number + params: URLSearchParams + depositionId?: number +} + +export async function getRunByIdV2({ + client, + id, + annotationsPage, + params = new URLSearchParams(), + depositionId, +}: GetRunByIdV2Params): Promise> { return client.query({ query: GET_RUN_BY_ID_QUERY_V2, variables: { diff --git a/frontend/packages/data-portal/app/routes/runs.$id.tsx b/frontend/packages/data-portal/app/routes/runs.$id.tsx index 480ee127a..895b921b4 100644 --- a/frontend/packages/data-portal/app/routes/runs.$id.tsx +++ b/frontend/packages/data-portal/app/routes/runs.$id.tsx @@ -57,13 +57,13 @@ export async function loader({ request, params }: LoaderFunctionArgs) { client: apolloClient, params: url.searchParams, }), - getRunByIdV2( - apolloClientV2, + getRunByIdV2({ + client: apolloClientV2, id, annotationsPage, - url.searchParams, - Number.isNaN(depositionId) ? undefined : depositionId, - ), + params: url.searchParams, + depositionId: Number.isNaN(depositionId) ? undefined : depositionId, + }), ]) if (responseV1.runs.length === 0) {