Skip to content

Commit

Permalink
fix(website): use MetadataFilter instead of FilterValue
Browse files Browse the repository at this point in the history
  • Loading branch information
bh-ethz committed Feb 8, 2024
1 parent d2cfa6c commit 232ebfb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions website/src/components/SearchPage/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { capitalCase } from 'change-case';
import type { FC, ReactElement } from 'react';

import { routes } from '../../routes.ts';
import type { MetadataFilter, MutationFilter, Schema } from '../../types/config.ts';
import type { FilterValue, MutationFilter, Schema } from '../../types/config.ts';
import type { OrderBy } from '../../types/lapis.ts';
import MdiTriangle from '~icons/mdi/triangle';
import MdiTriangleDown from '~icons/mdi/triangle-down';
Expand All @@ -15,7 +15,7 @@ type TableProps = {
organism: string;
schema: Schema;
data: TableSequenceData[];
metadataFilter: MetadataFilter[];
metadataFilter: FilterValue[];
mutationFilter: MutationFilter;
page: number;
orderBy: OrderBy;
Expand Down
6 changes: 3 additions & 3 deletions website/src/pages/[organism]/search/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { TableSequenceData } from '../../../components/SearchPage/Table.tsx
import { getReferenceGenomes, getSchema } from '../../../config.ts';
import { LapisClient } from '../../../services/lapisClient.ts';
import type { ProblemDetail } from '../../../types/backend.ts';
import type { FilterValue, MetadataFilter, MutationFilter } from '../../../types/config.ts';
import type { MetadataFilter, MutationFilter } from '../../../types/config.ts';
import { type LapisBaseRequest, type OrderBy, type OrderByType, orderByType } from '../../../types/lapis.ts';
import type { ReferenceGenomesSequenceNames } from '../../../types/referencesGenomes.ts';

Expand All @@ -13,15 +13,15 @@ export type SearchResponse = {
totalCount: number;
};

export function addHiddenFilters(searchFormFilter: FilterValue[], hiddenFilters: FilterValue[]) {
export function addHiddenFilters(searchFormFilter: MetadataFilter[], hiddenFilters: MetadataFilter[]) {
const searchFormFilterNames = searchFormFilter.map((filter) => filter.name);
const hiddenFiltersToAdd = hiddenFilters.filter((filter) => !searchFormFilterNames.includes(filter.name));
return [...searchFormFilter, ...hiddenFiltersToAdd];
}

export const getData = async (
organism: string,
metadataFilter: FilterValue[],
metadataFilter: MetadataFilter[],
mutationFilter: MutationFilter,
offset: number,
limit: number,
Expand Down

0 comments on commit 232ebfb

Please sign in to comment.