diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f6a312f..137f54d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ #### Changes * Fixed parts of the `Route.when` api, which had unexpected argument types. +# removed ResponseUtils.redirect and replaced it with Response.redirect() and also added Response.fromNode() ### 0.2.7 (December 8, 2023) diff --git a/jpro-routing/core/src/main/scala/one/jpro/platform/routing/Response.scala b/jpro-routing/core/src/main/scala/one/jpro/platform/routing/Response.scala index 3bc7e4e8..06740074 100644 --- a/jpro-routing/core/src/main/scala/one/jpro/platform/routing/Response.scala +++ b/jpro-routing/core/src/main/scala/one/jpro/platform/routing/Response.scala @@ -1,3 +1,10 @@ package one.jpro.platform.routing trait Response +object Response { + def empty(): Response = null + def redirect(to: String): Response = Redirect(to) + def fromNode(node: javafx.scene.Node): Response = new Response { + RouteUtils.viewFromNode(node) + } +} diff --git a/jpro-routing/core/src/main/scala/one/jpro/platform/routing/ResponseUtils.scala b/jpro-routing/core/src/main/scala/one/jpro/platform/routing/ResponseUtils.scala deleted file mode 100644 index 15e5e643..00000000 --- a/jpro-routing/core/src/main/scala/one/jpro/platform/routing/ResponseUtils.scala +++ /dev/null @@ -1,12 +0,0 @@ -package one.jpro.platform.routing - -/** - * ResponseUtils class. - * - * @author Besmir Beqiri - */ -object ResponseUtils { - - def redirect(to: String): Response = Redirect(to) - -}