Skip to content

Commit

Permalink
draft-api: Stop updating taxonomy metadata on unpublish
Browse files Browse the repository at this point in the history
  • Loading branch information
jnatten committed Nov 27, 2024
1 parent 238e2cb commit 78431b3
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,8 @@ trait StateTransitionRules {
SideEffect.withDraftAndUser("unpublishArticle")((article: Draft, user: TokenUser) =>
doIfArticleIsNotInUse(article.id.getOrElse(1), user) {
article.id match {
case Some(id) =>
val taxMetadataT = taxonomyApiClient.updateTaxonomyMetadataIfExists(id, visible = false, user)
val articleUpdT = articleApiClient.unpublishArticle(article, user)
val failures = Seq(taxMetadataT, articleUpdT).collectFirst { case Failure(ex) => Failure(ex) }
failures.getOrElse(articleUpdT)
case _ => Failure(NotFoundException("This is a bug, article to unpublish has no id."))
case Some(id) => articleApiClient.unpublishArticle(article, user)
case _ => Failure(NotFoundException("This is a bug, article to unpublish has no id."))
}
}
)
Expand Down

0 comments on commit 78431b3

Please sign in to comment.