diff --git a/src/app.ts b/src/app.ts index d68daa5..7d3f4e2 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,7 +1,5 @@ import express from 'express'; import routes from './routes'; -import { getAvailableTimeSlots } from './services/timeslotsService'; -import { getHolidays } from './services/holidaysService'; const app = express(); diff --git a/src/handlers.ts b/src/handlers.ts index e10dbda..c6010c2 100644 --- a/src/handlers.ts +++ b/src/handlers.ts @@ -1,18 +1,22 @@ import { Request, Response } from 'express'; import { resolveAddress } from './geocoding'; import { Address } from './types'; +// DOME +import { getAvailableTimeSlots } from './services/timeslotsService'; +import { getHolidays } from './services/holidaysService'; export const resolveAddressHandler = (req: Request, res: Response) => { - console.log("resolveAddressHandler called"); + console.info("resolveAddressHandler called"); const address: Promise
= resolveAddress(req.body.searchTerm); address.then((result) => { - console.log("resolveAddressHandler result: ", result); + console.info("resolveAddressHandler result: ", result); res.status(200).json(result); }) }; export const timeslotsHandler = (req: Request, res: Response) => { // TODO: Implement timeslots functionality + }; diff --git a/src/services/holidaysService.ts b/src/services/holidaysService.ts index ce163d7..589c035 100644 --- a/src/services/holidaysService.ts +++ b/src/services/holidaysService.ts @@ -1,6 +1,6 @@ +// for demo resolving the promise immediately with mock data import holidays from '../data/holidays.json'; export function getHolidays() { - // for demo resolving the promise immediately with mock data return Promise.resolve(holidays); } \ No newline at end of file diff --git a/src/services/timeslotsService.ts b/src/services/timeslotsService.ts index 84292cf..b388e87 100644 --- a/src/services/timeslotsService.ts +++ b/src/services/timeslotsService.ts @@ -1,6 +1,6 @@ +// for demo resolving the promise immediately with mock data import timeSlots from '../data/timeslots.json'; export function getAvailableTimeSlots() { - // for demo resolving the promise immediately with mock data return Promise.resolve(timeSlots); } \ No newline at end of file