Skip to content

Commit

Permalink
style : prettier형식으로 npm run format 적용 #35
Browse files Browse the repository at this point in the history
  • Loading branch information
GeunH committed Nov 17, 2023
1 parent 637cc01 commit a0c1153
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion be/src/auth/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ import { JwtStrategy } from "./strategy/jwt.strategy";
providers: [AuthService, JwtStrategy],
exports: [PassportModule],
})
export class AuthModule { }
export class AuthModule {}
2 changes: 1 addition & 1 deletion be/src/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { AuthGuard } from "@nestjs/passport";

@Controller("user")
export class UserController {
constructor(private userService: UserService) { }
constructor(private userService: UserService) {}

@Get(":nickname/details")
@UseGuards(AuthGuard("jwt"))
Expand Down
8 changes: 5 additions & 3 deletions be/src/user/user.decorator.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { ExecutionContext, createParamDecorator } from "@nestjs/common";

export interface TokenInfo {
nickName: string;
nickName: string;
}

export const GetUser = createParamDecorator((data, ctx: ExecutionContext): TokenInfo => {
export const GetUser = createParamDecorator(
(data, ctx: ExecutionContext): TokenInfo => {
const req = ctx.switchToHttp().getRequest();
return req.user;
})
}
);
3 changes: 1 addition & 2 deletions be/src/user/user.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ export class UserRepository extends Repository<User> {
});
if (userInfo) {
await this.update(userInfo.id, { deleted_at: new Date() });
}
else {
} else {
throw new ConflictException("Already Deleted");
}
return {};
Expand Down
6 changes: 2 additions & 4 deletions be/src/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class UserService {
constructor(
@InjectRepository(UserRepository)
private usersRepository: UserRepository
) { }
) {}
async signup(userInfoDto: UserInfoDto) {
return await this.usersRepository.createUser(userInfoDto);
}
Expand All @@ -25,8 +25,6 @@ export class UserService {
);
}
async deleteUserAccount(tokenInfo: TokenInfo) {
return await this.usersRepository.deleteUserAccount(
tokenInfo.nickName
);
return await this.usersRepository.deleteUserAccount(tokenInfo.nickName);
}
}

0 comments on commit a0c1153

Please sign in to comment.