~wegtam/smederee

Showing details for patch 38d5db9effdf341f2d33ce0b3ce6f34df648dc90.
2024-08-03 (Sat), 10:38 AM - Jens Grassel - 38d5db9effdf341f2d33ce0b3ce6f34df648dc90

chore: code cleanup

Summary of changes
3 files modified with 9 lines added and 9 lines removed
  • modules/hub/src/main/scala/de/smederee/tickets/Ticket.scala with 1 added and 1 removed lines
  • modules/hub/src/main/scala/de/smederee/tickets/TicketRoutes.scala with 4 added and 4 removed lines
  • modules/hub/src/test/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala with 4 added and 4 removed lines
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/tickets/TicketRoutes.scala new-smederee/modules/hub/src/main/scala/de/smederee/tickets/TicketRoutes.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/tickets/TicketRoutes.scala	2024-11-23 09:19:17.844891149 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/tickets/TicketRoutes.scala	2024-11-23 09:19:17.844891149 +0000
@@ -598,11 +598,11 @@
     private val showTicketsPage: AuthedRoutes[Account, F] = AuthedRoutes.of {
         case ar @ GET -> Root / UsernamePathParameter(projectOwnerName) / ProjectNamePathParameter(
                 projectName
-            ) / "tickets" :? TicketFilter.OptionalUrlParameter(maybeFilter) as user =>
+            ) / "tickets" :? TicketFilter.OptionalUrlParameter(filter) as user =>
             val response =
                 for {
                     csrf <- Sync[F].delay(ar.req.getCsrfToken)
-                    resp <- doShowTickets(maybeFilter)(csrf)(user.some)(projectOwnerName)(projectName)
+                    resp <- doShowTickets(filter)(csrf)(user.some)(projectOwnerName)(projectName)
                 } yield resp
             response.recoverWith { error =>
                 log.error("Internal Server Error", error)
@@ -617,10 +617,10 @@
     private val showTicketsForGuests: HttpRoutes[F] = HttpRoutes.of {
         case req @ GET -> Root / UsernamePathParameter(projectOwnerName) / ProjectNamePathParameter(
                 projectName
-            ) / "tickets" :? TicketFilter.OptionalUrlParameter(maybeFilter) =>
+            ) / "tickets" :? TicketFilter.OptionalUrlParameter(filter) =>
             for {
                 csrf <- Sync[F].delay(req.getCsrfToken)
-                resp <- doShowTickets(maybeFilter)(csrf)(None)(projectOwnerName)(projectName)
+                resp <- doShowTickets(filter)(csrf)(None)(projectOwnerName)(projectName)
             } yield resp
     }
 
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/tickets/Ticket.scala new-smederee/modules/hub/src/main/scala/de/smederee/tickets/Ticket.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/tickets/Ticket.scala	2024-11-23 09:19:17.844891149 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/tickets/Ticket.scala	2024-11-23 09:19:17.844891149 +0000
@@ -353,7 +353,7 @@
 
     /** Decode an optional possibly existing query parameter into a `TicketFilter`.
       *
-      * Usage: `case GET -> Root / "..." :? OptionalUrlParamter(maybeFilter) => ...`
+      * Usage: `case GET -> Root / "..." :? OptionalUrlParamter(filter) => ...`
       */
     object OptionalUrlParameter extends OptionalQueryParamDecoderMatcher[TicketFilter]("q")
 
diff -rN -u old-smederee/modules/hub/src/test/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala new-smederee/modules/hub/src/test/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala
--- old-smederee/modules/hub/src/test/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala	2024-11-23 09:19:17.844891149 +0000
+++ new-smederee/modules/hub/src/test/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala	2024-11-23 09:19:17.844891149 +0000
@@ -80,9 +80,9 @@
                 o <- repo.findUserSession(session.id)
             } yield (w, o)
             test.start.flatMap(_.joinWithNever).map { result =>
-                val (written, maybeSession) = result
+                val (written, foundSession) = result
                 assert(written === 1, "Creating user session must modify one database row!")
-                assert(clue(maybeSession) === clue(Option(session)))
+                assert(clue(foundSession) === clue(Option(session)))
             }
         }
     }
@@ -413,8 +413,8 @@
                 _ <- createUserSession(session)
                 o <- repo.findUserSession(session.id)
             } yield o
-            test.start.flatMap(_.joinWithNever).map { maybeSession =>
-                assert(clue(maybeSession) === clue(Option(session)))
+            test.start.flatMap(_.joinWithNever).map { foundSession =>
+                assert(clue(foundSession) === clue(Option(session)))
             }
         }
     }