Skip to content

Commit

Permalink
fix: 일부 버그 수정 (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
Coalery authored Nov 2, 2024
2 parents 26c6a92 + ab5fe97 commit 8463d94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/app/domain/cache/model/Cache.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import { Entity, PrimaryKey, Property } from '@mikro-orm/core';
import { IsDate, IsNotEmpty, IsString, Length } from 'class-validator';
import { IsDate, IsInt, IsNotEmpty, IsString, Length } from 'class-validator';

import { ClassValidator } from '@khlug/util/validator/ClassValidator';

export type CacheConstructorParams = {
id: string;
id: number;
name: string;
content: string;
updatedAt: Date;
};

export const CacheId = {
masterPassword: '100',
jajudyPassword: '101',
facilityTeamPassword: '102',
masterPassword: 100,
jajudyPassword: 101,
facilityTeamPassword: 102,
};

// 흔히 사용되는 용어 "캐시"를 가리키는 것이 아님.
// 레거시 모델로써, 테이블로 만들기에는 데이터의 수가 상당히 적으나,
// 동적으로 변경되어야 하는 데이터들이 모여있는 테이블.
@Entity({ tableName: 'khlug_cache' })
export class Cache {
@PrimaryKey({ type: 'varchar', length: 50, name: 'id' })
@IsString()
@PrimaryKey({ type: 'int', length: 11, name: 'id' })
@IsInt()
@IsNotEmpty()
private _id: string;
private _id: number;

@Property({ type: 'varchar', length: 255, name: 'name' })
@IsString()
Expand Down Expand Up @@ -54,7 +54,7 @@ export class Cache {
ClassValidator.validate(this);
}

get id(): string {
get id(): number {
return this._id;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/auth/AuthGuard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class AuthGuard implements CanActivate {
// TODO: User 엔티티 정의 후 수정 필요
const result: { manager: boolean }[] = await this.em
.getConnection()
.execute('SELECT * FROM khlug_member WHERE id = ?', [requesterUserId]);
.execute('SELECT * FROM khlug_members WHERE id = ?', [requesterUserId]);
if (!result || result.length === 0) {
throw new UnauthorizedException();
}
Expand Down

0 comments on commit 8463d94

Please sign in to comment.