Skip to content

Commit

Permalink
fix: save 트랜잭션 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
yunuo46 authored and peageon committed Dec 11, 2023
1 parent c041327 commit 74f76a4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
11 changes: 11 additions & 0 deletions back/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions back/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"class-validator": "^0.14.0",
"dotenv": "^16.3.1",
"express-basic-auth": "^1.2.1",
"k6": "^0.0.0",
"mysql2": "^3.6.3",
"passport": "^0.6.0",
"passport-facebook": "^3.0.0",
Expand Down
23 changes: 10 additions & 13 deletions back/src/modules/message/message.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,21 @@ export class MessageService {
...createMessageDto
});
try {
await this.messageRepository.save(messageEntity, {
transaction: false,
reload: false
const resCreateMessage = await this.messageRepository.save(
messageEntity,
{
transaction: false,
reload: false
}
);
console.log(resCreateMessage);
return plainToInstance(ResCreateMessageDto, resCreateMessage, {
excludeExtraneousValues: true
});
} catch (err) {
console.log(err);
throw new BadRequestException('Insert Fail');
}

const resCreateMessage = {
...createMessageDto,
...resClovaSentiment,
location: location
};

return plainToInstance(ResCreateMessageDto, resCreateMessage, {
excludeExtraneousValues: true
});
}

async isInsertAllowed(snowball_id: number): Promise<void> {
Expand Down
5 changes: 4 additions & 1 deletion back/src/modules/snowball/snowball.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export class SnowballService {
...createSnowballDto
});

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

const combinedSnowballDto = {
Expand Down

0 comments on commit 74f76a4

Please sign in to comment.