Skip to content

Commit

Permalink
Add events filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-petrov1 committed Apr 20, 2024
1 parent b7b60b4 commit 4606cda
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 459 deletions.
13 changes: 13 additions & 0 deletions client/src/config/api/events.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import { EventsFilterEnum } from '../../types';
import { baseApiUrl } from './base';

const base = `${baseApiUrl}/events`;

export const eventsPaths = Object.seal({
create: `${base}/create`,
filter: (
hasGoneTo: boolean,
numberEvents: number,
filterType: EventsFilterEnum
) => {
const url = new URL(`${base}/filter`);
url.searchParams.append('hasGoneTo', '' + hasGoneTo);
url.searchParams.append('numberEvents', numberEvents.toString());
url.searchParams.append('filterType', filterType.toString());

return url.toString();
},
});
Loading

0 comments on commit 4606cda

Please sign in to comment.