Skip to content

Commit

Permalink
add Request type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Sep 26, 2024
1 parent b438196 commit 37c9373
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class AuthController {

@Get('me/reservation')
@UseGuards(JwtAuthGuard)
async getOwnReservations(@Req() req) {
async getOwnReservations(@Req() req: Request) {
const user = req.user as JwtPayload;
const existUser = await this.userService.findOneByEmail(user.email);

Expand Down
8 changes: 4 additions & 4 deletions src/popo/reservation/equip/reserve.equip.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
UseGuards,
} from '@nestjs/common';
import { ApiQuery, ApiTags } from '@nestjs/swagger';

import { Request } from 'express';
import { ReserveEquipService } from './reserve.equip.service';
import { CreateReserveEquipDto } from './reserve.equip.dto';
import { MailService } from '../../../mail/mail.service';
Expand All @@ -38,7 +38,7 @@ export class ReserveEquipController {

@Post()
@UseGuards(JwtAuthGuard)
async post(@Req() req, @Body() dto: CreateReserveEquipDto) {
async post(@Req() req: Request, @Body() dto: CreateReserveEquipDto) {
const user = req.user as JwtPayload;

const saveDto = Object.assign(dto, { booker_id: user.uuid });
Expand Down Expand Up @@ -118,7 +118,7 @@ export class ReserveEquipController {

@Get('user')
@UseGuards(JwtAuthGuard)
async getMyReservation(@Req() req) {
async getMyReservation(@Req() req: Request) {
const user = req.user as JwtPayload;

const reservations = await this.reserveEquipService.find({
Expand Down Expand Up @@ -166,7 +166,7 @@ export class ReserveEquipController {

@Delete(':uuid')
@UseGuards(JwtAuthGuard)
async delete(@Param('uuid') uuid: string, @Req() req) {
async delete(@Param('uuid') uuid: string, @Req() req: Request) {
const reservation = await this.reserveEquipService.findOneByUuid(uuid);
const user = req.user as JwtPayload;

Expand Down
4 changes: 2 additions & 2 deletions src/popo/reservation/place/reserve.place.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class ReservePlaceController {

@Post()
@UseGuards(JwtAuthGuard)
async createWithNameAndId(@Req() req, @Body() dto: CreateReservePlaceDto) {
async createWithNameAndId(@Req() req: Request, @Body() dto: CreateReservePlaceDto) {

Check failure on line 62 in src/popo/reservation/place/reserve.place.controller.ts

View workflow job for this annotation

GitHub Actions / Prettier and ESLint check

Replace `@Req()·req:·Request,·@Body()·dto:·CreateReservePlaceDto` with `⏎····@Req()·req:·Request,⏎····@Body()·dto:·CreateReservePlaceDto,⏎··`
const user = req.user as JwtPayload;
const existPlace = await this.placeService.findOneByUuidOrFail(
dto.place_id,
Expand Down Expand Up @@ -290,7 +290,7 @@ export class ReservePlaceController {

@Delete(':uuid')
@UseGuards(JwtAuthGuard)
async delete(@Param('uuid') uuid: string, @Req() req) {
async delete(@Param('uuid') uuid: string, @Req() req: Request) {
const reservation =
await this.reservePlaceService.findOneByUuidOrFail(uuid);
const user = req.user as JwtPayload;
Expand Down

0 comments on commit 37c9373

Please sign in to comment.