Skip to content

Commit

Permalink
need api added
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Sep 20, 2023
1 parent ef753b9 commit fac159c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/features/need/need.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,16 @@ export class NeedController {
}
return await this.needService.getFlaskNeed(id);
}

@Get(`/:flaskId`)
@ApiOperation({ description: 'Get a need from db 2' })
async getNeedByFlaskId(@Req() req: Request, @Param('flaskId') flaskId: number) {
const panelFlaskUserId = req.headers['panelFlaskUserId'];
const panelFlaskTypeId = req.headers['panelFlaskTypeId'];
if (!isAuthenticated(panelFlaskUserId, panelFlaskTypeId)) {
throw new ForbiddenException(401, 'You Are not authorized!');
}
return await this.needService.getNeedByFlaskId(flaskId);
}
@Get(`preneeds`)
@ApiOperation({ description: 'Get all done needs from flask' })
async getPrNeed(@Req() req: Request) {
Expand Down

0 comments on commit fac159c

Please sign in to comment.