diff --git a/frontend/src/components/filters.tsx b/frontend/src/components/filters.tsx index 5f747c8..bbaa91b 100644 --- a/frontend/src/components/filters.tsx +++ b/frontend/src/components/filters.tsx @@ -3,6 +3,7 @@ import { CloseButton, Grid, MultiSelect, + Select, TextInput, rem, } from "@mantine/core"; @@ -15,10 +16,10 @@ export const Filters = observer(() => { return ( - { rootStore.setFilterFunction(value); diff --git a/frontend/src/stores/RootStore.ts b/frontend/src/stores/RootStore.ts index 2e6b789..9a9859d 100644 --- a/frontend/src/stores/RootStore.ts +++ b/frontend/src/stores/RootStore.ts @@ -42,6 +42,11 @@ export class RootStore { if (this.filterJobs.search) { params.search = this.filterJobs.search; } + + if (this.filterJobs.function.length) { + params.functionName = this.filterJobs.function; + } + try { const jobsData: IJobsInfo = await fetchJobs(params); runInAction(() => { @@ -131,8 +136,8 @@ export class RootStore { return Math.ceil(this.tableJobs.offset / this.tableJobs.limit) + 1; } - setFilterFunction(value: string[]) { - this.filterJobs.function = value; + setFilterFunction(value: string | null) { + this.filterJobs.function = value || ""; this.loadData(); } diff --git a/frontend/src/stores/models.ts b/frontend/src/stores/models.ts index 20a4fc0..41debae 100644 --- a/frontend/src/stores/models.ts +++ b/frontend/src/stores/models.ts @@ -69,7 +69,7 @@ export class JobsInfo { } export class FilterJobs { - function: string[] = []; + function: string = ""; status: string[] = []; search: string = "";