Skip to content

Commit

Permalink
fix: 스노우볼&메세지 생성 시 id 넘겨주도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yunuo46 committed Dec 11, 2023
1 parent 4c93f3a commit f5d0c37
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import { ApiProperty } from '@nestjs/swagger';
import { Expose } from 'class-transformer';

export class ResCreateMessageDto {
@Expose()
@IsNotEmpty()
@IsNumber()
@Min(1)
@ApiProperty({ type: Number, description: '메세지 id' })
readonly id: number;

@Expose()
@IsString()
@Length(1, 16)
Expand Down
9 changes: 1 addition & 8 deletions back/src/modules/message/message.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,7 @@ export class MessageService {
...createMessageDto
});
try {
const resCreateMessage = await this.messageRepository.save(
messageEntity,
{
transaction: false,
reload: false
}
);
console.log(resCreateMessage);
const resCreateMessage = await this.messageRepository.save(messageEntity);
return plainToInstance(ResCreateMessageDto, resCreateMessage, {
excludeExtraneousValues: true
});
Expand Down
5 changes: 1 addition & 4 deletions back/src/modules/snowball/snowball.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ export class SnowballService {
...createSnowballDto
});

const savedSnowballEntity = await this.snowballRepository.save(snowball, {
reload: false,
transaction: false
});
const savedSnowballEntity = await this.snowballRepository.save(snowball);
const savedSnowball = instanceToPlain(savedSnowballEntity);

const combinedSnowballDto = {
Expand Down

0 comments on commit f5d0c37

Please sign in to comment.