From 41b10d76c9bdd29f0b5fc27cc1d7bb05edee36d9 Mon Sep 17 00:00:00 2001 From: Swordsteel Date: Sun, 17 Aug 2025 09:45:57 +0200 Subject: [PATCH] form path changes --- .../ltd/hlaeja/controller/TypeController.kt | 16 ++++++++-------- .../templates/{device => }/type/form.html | 0 .../templates/{device => }/type/list.html | 0 3 files changed, 8 insertions(+), 8 deletions(-) rename src/main/resources/templates/{device => }/type/form.html (100%) rename src/main/resources/templates/{device => }/type/list.html (100%) diff --git a/src/main/kotlin/ltd/hlaeja/controller/TypeController.kt b/src/main/kotlin/ltd/hlaeja/controller/TypeController.kt index a862ba3..c581dce 100644 --- a/src/main/kotlin/ltd/hlaeja/controller/TypeController.kt +++ b/src/main/kotlin/ltd/hlaeja/controller/TypeController.kt @@ -48,12 +48,12 @@ class TypeController( model.addAttribute("items", items) model.addAttribute("pagination", Pagination(page, show, items.size, DEFAULT_SIZE)) } - .then(Mono.just("device/type/list")) + .then(Mono.just("type/list")) @GetMapping("/type/create") fun getCreateType( model: Model, - ): Mono = Mono.just("device/type/form") + ): Mono = Mono.just("type/form") .doOnNext { model.addAttribute("typeForm", TypeForm()) } @@ -66,7 +66,7 @@ class TypeController( ): Mono = if (bindingResult.hasErrors()) { model.addAttribute("typeForm", typeForm) model.addAttribute("validationErrors", validationErrors(bindingResult)) - Mono.just("device/type/form") + Mono.just("type/form") } else { Mono.just(typeForm) .flatMap { deviceRegistryService.createType(it.toTypeRequest()) } @@ -77,7 +77,7 @@ class TypeController( else -> "An unexpected error occurred. Please try again later." } model.addAttribute("validationErrors", listOf(errorMessage)) - Mono.just("device/type/form") + Mono.just("type/form") } } @@ -90,7 +90,7 @@ class TypeController( model.addAttribute("type", it) model.addAttribute("typeForm", it.toTypeForm()) } - .then(Mono.just("device/type/form")) + .then(Mono.just("type/form")) @PostMapping("/type-{type}") fun postEditType( @@ -106,7 +106,7 @@ class TypeController( model.addAttribute("validationErrors", validationErrors(bindingResult)) } .then( - Mono.just("device/type/form"), + Mono.just("type/form"), ) } else { Mono.just(typeForm) @@ -116,7 +116,7 @@ class TypeController( model.addAttribute("type", it) model.addAttribute("typeForm", it.toTypeForm()) } - .then(Mono.just("device/type/form")) + .then(Mono.just("type/form")) .onErrorResume { error -> val errorMessage = when (error) { is NoChangeException -> Pair("successMessage", "No change to save.") @@ -135,7 +135,7 @@ class TypeController( model.addAttribute("typeForm", typeForm) } .then( - Mono.just("device/type/form"), + Mono.just("type/form"), ) } } diff --git a/src/main/resources/templates/device/type/form.html b/src/main/resources/templates/type/form.html similarity index 100% rename from src/main/resources/templates/device/type/form.html rename to src/main/resources/templates/type/form.html diff --git a/src/main/resources/templates/device/type/list.html b/src/main/resources/templates/type/list.html similarity index 100% rename from src/main/resources/templates/device/type/list.html rename to src/main/resources/templates/type/list.html