Skip to content

Commit

Permalink
Update logic to actually update disclaimer
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinewi committed Dec 17, 2024
1 parent f74f831 commit 894d7de
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -797,15 +797,14 @@ trait ConverterService {
.flatten
)

val updatedDisclaimer = toMergeInto.disclaimer.map { disclaimer =>
mergeLanguageFields(
disclaimer,
maybeLang
.traverse(lang =>
articleWithNewContent.disclaimer.toSeq.map(d => toDomainDisclaimer(api.DisclaimerDTO(d, lang)))
)
.flatten
)
val updatedDisclaimer = articleWithNewContent.disclaimer match {
case None => toMergeInto.disclaimer
case Some(newDisclaimer) =>
val updated = mergeLanguageFields(
toMergeInto.disclaimer.getOrElse(Seq.empty),
maybeLang.map(lang => toDomainDisclaimer(api.DisclaimerDTO(newDisclaimer, lang))).toSeq
)
Option.when(updated.nonEmpty)(updated)
}

val updatedContents = mergeLanguageFields(
Expand Down

0 comments on commit 894d7de

Please sign in to comment.