Skip to content

Commit 5499c65

Browse files
authored
fix: bugs (#33)
1 parent 200f54e commit 5499c65

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

src/Evently.Server/Features/Gatherings/Controllers/GatheringsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task<ActionResult<List<Gathering>>> GetGatherings(string? attendeeI
3636
string? name,
3737
DateTimeOffset? startDateBefore, DateTimeOffset? startDateAfter, DateTimeOffset? endDateBefore, DateTimeOffset? endDateAfter,
3838
bool? isCancelled,
39-
long[]? categoryIds,
39+
[FromQuery(Name = "categoryIds[]")] long[]? categoryIds,
4040
int? offset, int? limit) {
4141
logger.LogInformation("categoryIds: {}", string.Join(",", values: categoryIds ?? []));
4242
PageResult<Gathering> result = await gatheringService.GetGatherings(attendeeId,

src/evently.client/src/lib/services/gathering-service.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,8 @@ export interface GetGatheringsParams {
1919
}
2020

2121
export async function getGatherings(params: GetGatheringsParams): Promise<PageResult<Gathering[]>> {
22-
const categoryIds: number[] = params.categoryIds ?? [];
2322
const queryParams: Record<string, any> = cloneDeep(params);
24-
delete queryParams["categoryIds"];
2523

26-
for (let i = 0; i < categoryIds.length; i++) {
27-
queryParams[`categoryIds[${i}]`] = categoryIds[i];
28-
}
2924
const response = await axios.get<Gathering[]>("/api/v1/Gatherings", { params: queryParams });
3025
const gatherings: Gathering[] = response.data;
3126
for (const gathering of gatherings) {

src/evently.client/src/routes/gatherings/-components/filter-bar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { type GetGatheringsParams, toIsoDateString } from "~/lib/services";
33
import { Category } from "~/lib/domains/entities";
44
import { DateTime } from "luxon";
55
import { Icon } from "@iconify/react";
6+
import React from "react";
67

78
interface FilterBarProps {
89
categories: Category[];

0 commit comments

Comments
 (0)