diff --git a/app/fetch_event.ts b/app/fetch_event.ts index 15d0d8e2a0739f9c3a8032e2374aa5beb1aa1391..b4e55cac879769cea48152d0dec79c1fd3f448e0 100644 --- a/app/fetch_event.ts +++ b/app/fetch_event.ts @@ -15,8 +15,6 @@ export type HoliEventResponse = { } export const toHoliEvent = (activity: Activity): HoliEvent | null => { - if (activity.period.permanent) return null - return { id: activity.id.toString(), title: activity.name, @@ -44,10 +42,10 @@ export const fetchEvent = async (input: FetchEventInput) => { const url = new URL(`${APP_API_BASE_URL}/activities/${input.id}`) const startDate = Date.now() - logger.info(`fetching event from ${url}`) + logger.debug(`fetching event from ${url}`) const response = await fetch(url) - if (response.status === 404) { + if (!response.ok) { throw new NotFound('Not found') } @@ -70,6 +68,6 @@ export const fetchEvent = async (input: FetchEventInput) => { throw e } finally { const duration = Date.now() - startDate - logger.debug(`fetching event took ${duration} ms`) + logger.info(`fetching event took ${duration} ms`) } } diff --git a/app/fetch_events.ts b/app/fetch_events.ts index e5439e8808822243f868e81da031929404bdb5c8..7d915ccccef49191240907afabafce4543a4238c 100644 --- a/app/fetch_events.ts +++ b/app/fetch_events.ts @@ -107,7 +107,7 @@ const fetchEventsPage = async ( const startDate = Date.now() - logger.info(`fetching projects from ${url}`) + logger.debug(`fetching events from ${url}`) try { const response = await fetch(url, { // gregor: we don't need to send the api key to the App api @@ -133,7 +133,7 @@ const fetchEventsPage = async ( throw e } finally { const duration = Date.now() - startDate - logger.debug(`fetching projects took ${duration} ms`) + logger.info(`fetching projects took ${duration} ms`) } } diff --git a/app/server.ts b/app/server.ts index 51dfff1aec5bdb614e8d404deb0f2b014631a149..8704cc296bf2d3f922ca6c8dc508138b5ea0f4ef 100644 --- a/app/server.ts +++ b/app/server.ts @@ -56,6 +56,7 @@ export type EventRequest = { } const validateEventsRequestInput = (request: EventsRequest): FetchEventsInput => { + logger.debug('validating request: ' + JSON.stringify(request)) return { limit: request.limit ?? 5, offset: request.offset ?? 0, @@ -64,7 +65,7 @@ const validateEventsRequestInput = (request: EventsRequest): FetchEventsInput => } const validateEventRequestInput = (request: EventRequest): FetchEventInput => { - console.log(request) + logger.debug('validating request: ' + JSON.stringify(request)) return { id: request.id, }