From 7b9d2bda8d1908b75535840c1eb33c32cd407d98 Mon Sep 17 00:00:00 2001 From: Gaute Rauboti Date: Fri, 1 Dec 2023 14:09:29 +0100 Subject: [PATCH] Formatting --- .../ndla/learningpathapi/repository/FolderRepository.scala | 5 ++++- .../scala/no/ndla/learningpathapi/service/ReadService.scala | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/learningpath-api/src/main/scala/no/ndla/learningpathapi/repository/FolderRepository.scala b/learningpath-api/src/main/scala/no/ndla/learningpathapi/repository/FolderRepository.scala index 8eddc2d3bc..f0f5400c21 100644 --- a/learningpath-api/src/main/scala/no/ndla/learningpathapi/repository/FolderRepository.scala +++ b/learningpath-api/src/main/scala/no/ndla/learningpathapi/repository/FolderRepository.scala @@ -380,7 +380,10 @@ trait FolderRepository { def getFolderAndChildrenSubfoldersWithResources(id: UUID, status: FolderStatus.Value, feideId: FeideID)(implicit session: DBSession ): Try[Option[Folder]] = { - getFolderAndChildrenSubfoldersWithResourcesWhere(id, sqls"AND (child.status = ${status.toString} OR child.feide_id = ${feideId.toString})") + getFolderAndChildrenSubfoldersWithResourcesWhere( + id, + sqls"AND (child.status = ${status.toString} OR child.feide_id = ${feideId.toString})" + ) } /** A flat list of the folder with `id` as well as its children folders. The folders in the list comes with diff --git a/learningpath-api/src/main/scala/no/ndla/learningpathapi/service/ReadService.scala b/learningpath-api/src/main/scala/no/ndla/learningpathapi/service/ReadService.scala index 9860b29aa4..4b8abc8e6c 100644 --- a/learningpath-api/src/main/scala/no/ndla/learningpathapi/service/ReadService.scala +++ b/learningpath-api/src/main/scala/no/ndla/learningpathapi/service/ReadService.scala @@ -383,7 +383,8 @@ trait ReadService { def getSharedFolder(id: UUID, maybeFeideToken: Option[FeideAccessToken]): Try[api.Folder] = { implicit val session: DBSession = folderRepository.getSession(true) val feide_id = withFeideId(maybeFeideToken)(feideId => exportUserDataAuthenticated(maybeFeideToken, feideId)) - val folderWithResources = folderRepository.getFolderAndChildrenSubfoldersWithResources(id, FolderStatus.SHARED, feide_id.toString()) + val folderWithResources = + folderRepository.getFolderAndChildrenSubfoldersWithResources(id, FolderStatus.SHARED, feide_id.toString()) for { folderWithContent <- getWith404IfNone(id, folderWithResources) _ <- if (folderWithContent.isShared) Success(()) else Failure(NotFoundException("Folder does not exist"))