From 76af0ce120473b076241df61ccd2abdcd1231c1a Mon Sep 17 00:00:00 2001 From: David Hochbaum Date: Thu, 23 May 2024 14:57:43 -0400 Subject: [PATCH] Updating endpoint to serve the array as a value on a key in an object --- src/borough/borough.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/borough/borough.service.ts b/src/borough/borough.service.ts index 233273c6..5ce4c4bd 100644 --- a/src/borough/borough.service.ts +++ b/src/borough/borough.service.ts @@ -16,15 +16,15 @@ export class BoroughService { }; } - async findCommunityDistrictsByBoroughId(id: string) { + async findCommunityDistrictsByBoroughId(boroughId: string) { const communityDistricts = - await this.boroughRepository.findCommunityDistrictsByBoroughId(id); + await this.boroughRepository.findCommunityDistrictsByBoroughId(boroughId); if (communityDistricts === undefined) throw new ResourceNotFoundException(); if (communityDistricts.length === 0) { - const boroughCheck = await this.boroughRepository.checkBoroughById(id); + const boroughCheck = await this.boroughRepository.checkBoroughById(boroughId); if (boroughCheck === undefined) throw new ResourceNotFoundException(); } - return communityDistricts; + return { communityDistricts }; } }