Skip to content

Commit

Permalink
remove braces
Browse files Browse the repository at this point in the history
  • Loading branch information
kraktus committed Jul 9, 2024
1 parent 261581e commit 854a841
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions modules/study/src/main/StudyApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -771,23 +771,19 @@ final class StudyApi(

def editStudy(studyId: StudyId, data: Study.Data)(who: Who) =
sequenceStudy(studyId): study =>
canActAsOwner(study, who.u).flatMap { asOwner =>
asOwner.option(data.settings).so { settings =>
canActAsOwner(study, who.u).flatMap: asOwner =>
asOwner.option(data.settings).so: settings =>
val newStudy = study
.copy(
name = Study.toName(data.name),
flair = data.flair.flatMap(flairApi.find),
settings = settings,
visibility = data.vis,
description = settings.description.option {
description = settings.description.option:
study.description.filter(_.nonEmpty) | "-"
}
)
(newStudy != study).so {
(newStudy != study).so:
studyRepo.updateSomeFields(newStudy).andDo(sendTo(study.id)(_.reloadAll)).andDo(indexStudy(study))
}
}
}

def delete(study: Study) =
sequenceStudy(study.id): study =>
Expand Down

0 comments on commit 854a841

Please sign in to comment.