From aa099a340e7237c8b2f1f96d7fd3cbda70409796 Mon Sep 17 00:00:00 2001 From: eikek Date: Sun, 5 Sep 2021 17:32:32 +0200 Subject: [PATCH] Remove unused code --- .../docspell/backend/ops/OCollective.scala | 22 ------------------- .../docspell/backend/signup/OSignup.scala | 1 - .../backend/signup/RegisterData.scala | 9 ++++++++ .../restserver/routes/RegisterRoutes.scala | 3 +-- 4 files changed, 10 insertions(+), 25 deletions(-) create mode 100644 modules/backend/src/main/scala/docspell/backend/signup/RegisterData.scala diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OCollective.scala b/modules/backend/src/main/scala/docspell/backend/ops/OCollective.scala index 4f1b1787..0efc7225 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OCollective.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OCollective.scala @@ -115,28 +115,6 @@ object OCollective { def userNotLocal: PassChangeResult = UserNotLocal } - case class RegisterData( - collName: Ident, - login: Ident, - password: Password, - invite: Option[Ident] - ) - - sealed trait RegisterResult { - def toEither: Either[Throwable, Unit] - } - object RegisterResult { - case object Success extends RegisterResult { - val toEither = Right(()) - } - case class CollectiveExists(id: Ident) extends RegisterResult { - val toEither = Left(new Exception()) - } - case class Error(ex: Throwable) extends RegisterResult { - val toEither = Left(ex) - } - } - def apply[F[_]: Async]( store: Store[F], uts: UserTaskStore[F], diff --git a/modules/backend/src/main/scala/docspell/backend/signup/OSignup.scala b/modules/backend/src/main/scala/docspell/backend/signup/OSignup.scala index 6c1add2c..89a10866 100644 --- a/modules/backend/src/main/scala/docspell/backend/signup/OSignup.scala +++ b/modules/backend/src/main/scala/docspell/backend/signup/OSignup.scala @@ -10,7 +10,6 @@ import cats.effect.{Async, Resource} import cats.implicits._ import docspell.backend.PasswordCrypt -import docspell.backend.ops.OCollective.RegisterData import docspell.common._ import docspell.common.syntax.all._ import docspell.store.records.{RCollective, RInvitation, RUser} diff --git a/modules/backend/src/main/scala/docspell/backend/signup/RegisterData.scala b/modules/backend/src/main/scala/docspell/backend/signup/RegisterData.scala new file mode 100644 index 00000000..3ce905be --- /dev/null +++ b/modules/backend/src/main/scala/docspell/backend/signup/RegisterData.scala @@ -0,0 +1,9 @@ +package docspell.backend.signup +import docspell.common._ + +case class RegisterData( + collName: Ident, + login: Ident, + password: Password, + invite: Option[Ident] +) diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/RegisterRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/RegisterRoutes.scala index 834b61c3..d3139479 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/RegisterRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/RegisterRoutes.scala @@ -10,8 +10,7 @@ import cats.effect._ import cats.implicits._ import docspell.backend.BackendApp -import docspell.backend.ops.OCollective.RegisterData -import docspell.backend.signup.{NewInviteResult, SignupResult} +import docspell.backend.signup.{NewInviteResult, RegisterData, SignupResult} import docspell.restapi.model._ import docspell.restserver.Config import docspell.restserver.http4s.ResponseGenerator