From 2b27274b559ebbf4854dce91ce79f0c7378d81bb Mon Sep 17 00:00:00 2001 From: Matthew Petro Date: Sun, 3 Mar 2024 01:05:16 -0700 Subject: [PATCH] Return object instead of Map from sunrise sunset controller --- src/sunrise-sunset/sunrise-sunset.controller.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sunrise-sunset/sunrise-sunset.controller.ts b/src/sunrise-sunset/sunrise-sunset.controller.ts index 9d0ff78..be2df76 100644 --- a/src/sunrise-sunset/sunrise-sunset.controller.ts +++ b/src/sunrise-sunset/sunrise-sunset.controller.ts @@ -15,7 +15,8 @@ export class SunriseSunsetController { constructor(private sunriseSunsetService: SunriseSunsetService) {} @Get() - async get(@Query() { startDate, endDate }: QueryParameters): Promise { - return this.sunriseSunsetService.getSunriseSunsets(parseISO(startDate), parseISO(endDate)) + async get(@Query() { startDate, endDate }: QueryParameters) { + const result = await this.sunriseSunsetService.getSunriseSunsets(parseISO(startDate), parseISO(endDate)) + return Object.fromEntries(result) } }