diff --git a/back/package-lock.json b/back/package-lock.json index 75bd631..30a1319 100644 --- a/back/package-lock.json +++ b/back/package-lock.json @@ -25,6 +25,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", @@ -7095,6 +7096,11 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/k6": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/k6/-/k6-0.0.0.tgz", + "integrity": "sha512-GAQSWayS2+LjbH5bkRi+pMPYyP1JSp7o+4j58ANZ762N/RH/SdlAT3CHHztnn8s/xgg8kYNM24Gd2IPo9b5W+g==" + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -16202,6 +16208,11 @@ "safe-buffer": "^5.0.1" } }, + "k6": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/k6/-/k6-0.0.0.tgz", + "integrity": "sha512-GAQSWayS2+LjbH5bkRi+pMPYyP1JSp7o+4j58ANZ762N/RH/SdlAT3CHHztnn8s/xgg8kYNM24Gd2IPo9b5W+g==" + }, "keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", diff --git a/back/package.json b/back/package.json index e3372f5..bc39b1a 100644 --- a/back/package.json +++ b/back/package.json @@ -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", diff --git a/back/src/modules/message/message.service.ts b/back/src/modules/message/message.service.ts index 65c4ddc..24a7ba2 100644 --- a/back/src/modules/message/message.service.ts +++ b/back/src/modules/message/message.service.ts @@ -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 { diff --git a/back/src/modules/snowball/snowball.service.ts b/back/src/modules/snowball/snowball.service.ts index 09dc896..ac8deb8 100644 --- a/back/src/modules/snowball/snowball.service.ts +++ b/back/src/modules/snowball/snowball.service.ts @@ -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 = {