Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rauboti committed Dec 1, 2023
1 parent 8dd236c commit 7b9d2bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 7b9d2bd

Please sign in to comment.