From 4ce5023c8c49f0281d87200a54f66bdbd66aa5f1 Mon Sep 17 00:00:00 2001 From: Flo <1926041+dtrucs@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:29:05 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: mab --- frontend/src/modules/touristicEvent/api.ts | 36 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/frontend/src/modules/touristicEvent/api.ts b/frontend/src/modules/touristicEvent/api.ts index 6445c9882..b9a5a0ea1 100644 --- a/frontend/src/modules/touristicEvent/api.ts +++ b/frontend/src/modules/touristicEvent/api.ts @@ -5,8 +5,20 @@ import { APIQuery, APIResponseForList } from 'services/api/interface'; import { RawTouristicEvent, RawTouristicEventDetails } from './interface'; const fieldsParams = { - fields: - 'id,attachments,name,geometry,themes,cities,type,begin_date,end_date,approved,start_time,end_time', + fields: [ + 'id', + 'attachments', + 'name', + 'geometry', + 'themes', + 'cities', + 'type', + 'begin_date', + 'end_date', + 'approved', + 'start_time', + 'end_time', + ].join(','), }; export const fetchTouristicEvents = ( @@ -22,7 +34,25 @@ export const fetchTouristicEvents = ( }; const fieldsParamsDetails = { - fields: `${fieldsParams.fields},description,description_teaser,participant_number,pdf,meeting_point,duration,source,contact,email,website,accessibility,organizer,speaker,target_audience,practical_info,booking`, + fields: [ + fieldsParams.fields, + 'description', + 'description_teaser', + 'participant_number', + 'pdf', + 'meeting_point', + 'duration', + 'source', + 'contact', + 'email', + 'website', + 'accessibility', + 'organizer', + 'speaker', + 'target_audience', + 'practical_info', + 'booking', + ].join(','), format: 'geojson', };