diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7334360..8d3784d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,4 +17,4 @@ jobs: - name: Use Node.js uses: actions/setup-node@v1 - name: install and then run linter - run: npm install eslint && npm run lint \ No newline at end of file + run: npm install eslint && npm run lint diff --git a/src/assignment/assignment.controller.ts b/src/assignment/assignment.controller.ts index 9d5a1d4..e3f3102 100644 --- a/src/assignment/assignment.controller.ts +++ b/src/assignment/assignment.controller.ts @@ -39,7 +39,7 @@ export class AssignmentController { @Post() @UsePipes(ValidationPipe) async addAssignment( - @Res() res, + @Res({ passthrough: true }) res, @Body() CreateAssignmentDTO: CreateAssignmentDTO, ) { const Assignment = await this.AssignmentService.addAssignment( @@ -54,7 +54,7 @@ export class AssignmentController { // Retrieve Assignments list @ApiCreatedResponse({ type: [AssignmentResponseBody] }) @Get() - async getAllAssignment(@Res() res) { + async getAllAssignment(@Res({ passthrough: true }) res) { const Assignments = await this.AssignmentService.getAllAssignment(); return res.status(HttpStatus.OK).json(Assignments); } @@ -62,14 +62,17 @@ export class AssignmentController { // Fetch a particular Assignment using ID @ApiCreatedResponse({ type: AssignmentResponseBody }) @Get('/:AssignmentId') - async getAssignment(@Res() res, @Param('AssignmentId') AssignmentId: string) { + async getAssignment( + @Res({ passthrough: true }) res, + @Param('AssignmentId') AssignmentId: string, + ) { const Assignment = await this.AssignmentService.getAssignment(AssignmentId); return res.status(HttpStatus.OK).json(Assignment); } @Put('/update') async updateAssignment( - @Res() res, + @Res({ passthrough: true }) res, @Query('uid') uid, @Body() createAssignmentDTO: CreateAssignmentDTO, ) { @@ -89,7 +92,7 @@ export class AssignmentController { // Delete a Assignment @Delete('/delete') - async deleteAssignment(@Res() res, @Query('uid') uid) { + async deleteAssignment(@Res({ passthrough: true }) res, @Query('uid') uid) { const Assignment = await this.AssignmentService.deleteAssignment(uid); if (!Assignment) throw new NotFoundException('Assignment does not exist'); return res.status(HttpStatus.OK).json({