Skip to content

Commit

Permalink
Updating endpoint to serve the array as a value on a key in an object
Browse files Browse the repository at this point in the history
  • Loading branch information
dhochbaum-dcp committed May 23, 2024
1 parent 6bd0c90 commit 76af0ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/borough/borough.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
}

0 comments on commit 76af0ce

Please sign in to comment.