Skip to content

Commit

Permalink
Merge pull request #51 from gsainfoteam/49-psw
Browse files Browse the repository at this point in the history
add category when writing
  • Loading branch information
siwonpada authored Jun 19, 2024
2 parents ff0a9ea + 3eb3674 commit 35937fd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/notice/dto/req/createNotice.dto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { ApiProperty } from '@nestjs/swagger';
import { Category } from '@prisma/client';
import { Type } from 'class-transformer';
import {
IsDate,
IsEnum,
IsNotEmpty,
IsNumber,
IsOptional,
Expand Down Expand Up @@ -48,6 +50,15 @@ export class CreateNoticeDto {
@IsOptional()
tags: number[] = [];

@ApiProperty({
description: '공지 그룹의 id',
type: Category,
required: false,
})
@IsEnum(Category)
@IsOptional()
category?: Category;

@ApiProperty({
example: 'wow.png',
description: '이미지 파일 이름',
Expand Down
2 changes: 2 additions & 0 deletions src/notice/notice.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export class NoticeRepository {
images,
documents,
groupName,
category,
}: CreateNoticeDto,
userUuid: string,
createdAt?: Date,
Expand Down Expand Up @@ -382,6 +383,7 @@ export class NoticeRepository {
})),
],
},
category,
group:
groupName === undefined
? undefined
Expand Down

0 comments on commit 35937fd

Please sign in to comment.