Skip to content

Commit

Permalink
Comment out pipe to get capital projects
Browse files Browse the repository at this point in the history
  • Loading branch information
pratishta committed Jun 18, 2024
1 parent 7d946b4 commit d2e9be2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/borough/borough.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ export class BoroughController {
}

@Get("/:boroughId/community-districts/:communityDistrictId/capital-projects")
@UsePipes(
new ZodValidationPipe(findCapitalProjectsByBoroughIdCommunityDistrictIdPathParamsSchema),
)
// TODO: Add validation pipes
async findCapitalProjectsByBoroughIdCommunityDistrictId(
@Param() pathParams: FindCapitalProjectsByBoroughIdCommunityDistrictIdPathParams,
@Query() queryParams: FindCapitalProjectsByBoroughIdCommunityDistrictIdQueryParams,
Expand Down
2 changes: 2 additions & 0 deletions src/borough/borough.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class BoroughRepository {
.prepare("checkBoroughById");

async checkBoroughById(id: string): Promise<CheckByIdRepo | undefined> {
console.log("check borough by id");
try {
return await this.#checkBoroughById.execute({
id,
Expand All @@ -45,6 +46,7 @@ export class BoroughRepository {
.prepare("checkCommunityDistrictId");

async checkCommunityDistrictById(id: string): Promise<CheckByIdRepo | undefined> {
console.log("check community district by id");
try {
return await this.#checkCommunityDistrictById.execute({
id,
Expand Down
14 changes: 9 additions & 5 deletions src/borough/borough.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,22 @@ export class BoroughService {
FindCapitalProjectsByBoroughIdCommunityDistrictIdQueryParams)
{
const boroughCheck = await this.boroughRepository.checkBoroughById(boroughId);
if (boroughCheck === undefined) throw new ResourceNotFoundException();

const communityDistrictCheck = await this.boroughRepository.checkCommunityDistrictById(communityDistrictId);
if (communityDistrictCheck === undefined) throw new ResourceNotFoundException();

const capitalProjects = await this.boroughRepository.findCapitalProjectsByBoroughIdCommunityDistrictId({
const capitalProjects = await this.boroughRepository.findCapitalProjectsByBoroughIdCommunityDistrictId({
boroughId,
communityDistrictId,
limit,
offset,
});

console.log(capitalProjects);
})
return {
capitalProjects,
limit,
offset,
total: capitalProjects.length,
order: "managingCode, capitalProjectId", capitalProjects,
}
}
}

0 comments on commit d2e9be2

Please sign in to comment.