Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
extract period to config constants
Browse files Browse the repository at this point in the history
  • Loading branch information
appinteractive authored and ManAnRuck committed Jan 7, 2023
1 parent 13ff81b commit da236f1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/templates/FilteredPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
filterForTypeState,
filterState,
} from '@/components/state/states';
import { config } from '@/config/constants';
import { Meta } from '@/layout/Meta';
import { GET_PROCEDURES } from '@/queries/get-procedures';
import { Main } from '@/templates/Main';
Expand Down Expand Up @@ -56,7 +57,7 @@ export default function FilteredPage({ listTypes, title, description }: Props) {
offset: 0,
pageSize,
sort: 'voteDate',
period: 20,
period: config.period,
context: {
debounceKey: title,
},
Expand Down
3 changes: 3 additions & 0 deletions src/config/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const config = {
period: 20,
};
3 changes: 2 additions & 1 deletion src/pages/suche.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Card from '@/components/molecules/Card';
import Empty from '@/components/molecules/Empty';
import Loading from '@/components/molecules/Loading';
import { searchTermState } from '@/components/state/states';
import { config } from '@/config/constants';
import { Meta } from '@/layout/Meta';
import { SEARCH_PROCEDURES } from '@/queries/search-procedures';
import { Main } from '@/templates/Main';
Expand All @@ -18,7 +19,7 @@ export default function Top100Page() {
const { loading, data, error } = useQuery(SEARCH_PROCEDURES, {
variables: {
term: searchTerm ?? null,
period: 20,
period: config.period,
},
context: {
// Requests get debounced together if they share the same debounceKey.
Expand Down

0 comments on commit da236f1

Please sign in to comment.