Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
bchu1 committed Dec 23, 2024
1 parent 4793249 commit c7d8341
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
22 changes: 15 additions & 7 deletions frontend/packages/data-portal/app/graphql/getRunByIdV2.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,21 @@ function getAnnotationShapesFilter(
return where
}

export async function getRunByIdV2(
client: ApolloClient<NormalizedCacheObject>,
id: number,
annotationsPage: number,
params: URLSearchParams = new URLSearchParams(),
depositionId?: number,
): Promise<ApolloQueryResult<GetRunByIdV2Query>> {
export interface GetRunByIdV2Params {
client: ApolloClient<NormalizedCacheObject>
id: number
annotationsPage: number
params: URLSearchParams
depositionId?: number
}

export async function getRunByIdV2({
client,
id,
annotationsPage,
params = new URLSearchParams(),
depositionId,
}: GetRunByIdV2Params): Promise<ApolloQueryResult<GetRunByIdV2Query>> {
return client.query({
query: GET_RUN_BY_ID_QUERY_V2,
variables: {
Expand Down
10 changes: 5 additions & 5 deletions frontend/packages/data-portal/app/routes/runs.$id.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c7d8341

Please sign in to comment.