-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Map API 수정 및 맛집 삭제 API, 키워드 저장 로직 추가 #34
Changes from all commits
1265d14
348a2d3
ce02fa5
787be55
964ce81
3d7270a
107dbeb
78cd33a
6c8736c
e02566b
a2de253
b2b916b
d698e19
a8e08cb
4ced443
6500484
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export const IS_DEV = process.env.NODE_ENV === 'development'; | ||
export const IS_STAGE = process.env.NODE_ENV === 'stage'; | ||
export const IS_PROD = process.env.NODE_ENV === 'production'; | ||
export const SEARCH_KEYWORD_MAX_LENGTH = 10; | ||
export const INVITE_LINK_EXPIRATION_DAYS = 7; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,15 +6,16 @@ import { | |
PrimaryKey, | ||
Property, | ||
} from '@mikro-orm/core'; | ||
import { v4 as uuid } from 'uuid'; | ||
|
||
import { GroupMapRepository, UserMap } from 'src/entities'; | ||
|
||
@Entity({ tableName: 'map', repository: () => GroupMapRepository }) | ||
export class GroupMap { | ||
@PrimaryKey() | ||
id: string; | ||
@PrimaryKey({ type: 'uuid' }) | ||
id: string = uuid(); | ||
|
||
@Property({ type: 'string' }) | ||
@Property({ type: 'string', unique: true }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. class validator로 unique 침범하면, 에러 메시지 커스텀하게 보여줄 수 있도록 하는 건 어떨까요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오~ 좋은데 한번 해볼게 감사링! |
||
name: string; | ||
|
||
@OneToMany({ entity: () => UserMap, mappedBy: (userMap) => userMap.map }) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ import { | |
Entity, | ||
EntityRepositoryType, | ||
ManyToOne, | ||
OneToOne, | ||
PrimaryKeyProp, | ||
Property, | ||
Rel, | ||
|
@@ -38,7 +37,7 @@ export class PlaceForMap { | |
}) | ||
likedUserIds: number[]; | ||
|
||
@OneToOne(() => User) | ||
@ManyToOne(() => User) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good |
||
createdBy: User; | ||
|
||
@Property() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
import { IsNotEmpty } from 'class-validator'; | ||
import { IsNotEmpty, Validate } from 'class-validator'; | ||
|
||
import { GroupMap } from 'src/entities'; | ||
import { IsMapNameUnique } from 'src/map/validator/is-map-name-unique.validator'; | ||
|
||
export class CreateMapDto implements Partial<GroupMap> { | ||
@ApiProperty() | ||
@IsNotEmpty() | ||
id: string; | ||
|
||
@ApiProperty() | ||
@IsNotEmpty() | ||
@Validate(IsMapNameUnique) | ||
name: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
썃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅋㅋㅋㅋㅋㅋㅋㅋㅋ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅋㅋㅋㅋㅋ