From 78431b3f5648968b647a02b5c3d6a3bb0619ba3f Mon Sep 17 00:00:00 2001 From: Jonas Natten Date: Wed, 27 Nov 2024 08:55:21 +0100 Subject: [PATCH] draft-api: Stop updating taxonomy metadata on unpublish --- .../no/ndla/draftapi/service/StateTransitionRules.scala | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/draft-api/src/main/scala/no/ndla/draftapi/service/StateTransitionRules.scala b/draft-api/src/main/scala/no/ndla/draftapi/service/StateTransitionRules.scala index 257bf9be7..a65a10ec4 100644 --- a/draft-api/src/main/scala/no/ndla/draftapi/service/StateTransitionRules.scala +++ b/draft-api/src/main/scala/no/ndla/draftapi/service/StateTransitionRules.scala @@ -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.")) } } )