diff --git a/client/src/components/Trips/TripTagField.tsx b/client/src/components/Trips/TripTagField.tsx index b96e562f1..759d8c17f 100644 --- a/client/src/components/Trips/TripTagField.tsx +++ b/client/src/components/Trips/TripTagField.tsx @@ -93,7 +93,7 @@ export function TripTagField({ const [active, setActive] = useState(false); const [highlighted, setHighlighted] = useState(-1); const [options, setOptions] = useState([]); - const selected = new Set(tags.map(tripTagKey)); + const selected = new Set(tags.map((tag) => tripTagKey(tag))); const draftKey = tripTagKey(draft); const atLimit = tags.length >= MAX_TRIP_TAGS; const canAdd = !atLimit && draftKey.length > 0 && !selected.has(draftKey); diff --git a/server/src/nest/trips/trips.helpers.ts b/server/src/nest/trips/trips.helpers.ts index e449b1961..a6313a38b 100644 --- a/server/src/nest/trips/trips.helpers.ts +++ b/server/src/nest/trips/trips.helpers.ts @@ -32,7 +32,7 @@ export interface CreateTripData { export type UpdateTripData = TripUpdateRequest & { add_tags?: string[]; remove_tags?: string[] }; export function patchTripTags(current: string[], add: string[] = [], remove: string[] = []): string[] { - const removed = new Set(remove.map(tripTagKey)); + const removed = new Set(remove.map((tag) => tripTagKey(tag))); const tags = uniqueTripTags([...current.filter((tag) => !removed.has(tripTagKey(tag))), ...add]); if (tags.length > MAX_TRIP_TAGS) throw new ValidationError(`A trip can have up to ${MAX_TRIP_TAGS} tags.`); return tags;