mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 18:34:09 +00:00
fix(ci): pass only tag names to the tag key mapper
Use an explicit single-argument callback for tag arrays so the mapper cannot receive an index or array from map.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user