Skip to content

Commit

Permalink
Feat: Add to create, and update plainTextDescription.
Browse files Browse the repository at this point in the history
  • Loading branch information
huGgW committed Sep 8, 2023
1 parent b271910 commit 9a811c8
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.wafflestudio.csereal.core.news.database

import com.wafflestudio.csereal.common.cleanTextFromHtml
import com.wafflestudio.csereal.common.config.BaseTimeEntity
import com.wafflestudio.csereal.common.controller.AttachmentContentEntityType
import com.wafflestudio.csereal.common.controller.MainImageContentEntityType
Expand Down Expand Up @@ -45,15 +46,20 @@ class NewsEntity(
return NewsEntity(
title = newsDto.title,
description = newsDto.description,
plainTextDescription = cleanTextFromHtml(newsDto.description),
isPublic = newsDto.isPublic,
isSlide = newsDto.isSlide,
isImportant = newsDto.isImportant,
)
}
}
fun update(updateNewsRequest: NewsDto) {
if (updateNewsRequest.description != this.description) {
this.description = updateNewsRequest.description
this.plainTextDescription = cleanTextFromHtml(updateNewsRequest.description)
}

this.title = updateNewsRequest.title
this.description = updateNewsRequest.description
this.isPublic = updateNewsRequest.isPublic
this.isSlide = updateNewsRequest.isSlide
this.isImportant = updateNewsRequest.isImportant
Expand Down

0 comments on commit 9a811c8

Please sign in to comment.