Skip to content

Commit

Permalink
Merge pull request #203 from boostcampwm2023/fix/202-diary-create-no-…
Browse files Browse the repository at this point in the history
…content

[Fix] 일기 생성, 수정 시 Content 관련 오류 수정
  • Loading branch information
JoonSoo-Kim authored Dec 4, 2023
2 parents c486b46 + 370c21e commit 76706ff
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions BE/src/diaries/diaries.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export class DiariesService {

async writeDiary(createDiaryDto: CreateDiaryDto, user: User): Promise<Diary> {
const { content, shapeUuid, tags } = createDiaryDto;
const trimContent = content.trim();
const shape = await this.shapesRepository.getShapeByUuid(shapeUuid);
const encryptedContent = await this.getEncryptedContent(content);
const encryptedContent = await this.getEncryptedContent(trimContent);
const tagEntities = await this.getTags(tags);
const sentimentResult: SentimentDto = await this.getSentiment(content);

const sentimentResult: SentimentDto = await this.getSentiment(trimContent);
const diary = await this.diariesRepository.createDiary(
createDiaryDto,
encryptedContent,
Expand Down Expand Up @@ -76,10 +76,11 @@ export class DiariesService {
user: User,
): Promise<Diary> {
const { content, shapeUuid, tags } = updateDiaryDto;
const trimContent = content.trim();
const shape = await this.shapesRepository.getShapeByUuid(shapeUuid);
const encryptedContent = await this.getEncryptedContent(content);
const encryptedContent = await this.getEncryptedContent(trimContent);
const tagEntities = await this.getTags(tags);
const sentimentResult = await this.getSentiment(content);
const sentimentResult = await this.getSentiment(trimContent);

return this.diariesRepository.updateDiary(
updateDiaryDto,
Expand Down

0 comments on commit 76706ff

Please sign in to comment.