fixed bug on adding a value in the booking view of a single user
This commit is contained in:
parent
500ec2b9ad
commit
fee73a1e0c
@ -18,7 +18,7 @@ apply plugin: 'war'
|
|||||||
apply plugin: 'application'
|
apply plugin: 'application'
|
||||||
|
|
||||||
group = 'de.jottyfan.camporganizer'
|
group = 'de.jottyfan.camporganizer'
|
||||||
version = '0.1.0'
|
version = '0.1.1'
|
||||||
sourceCompatibility = 17
|
sourceCompatibility = 17
|
||||||
mainClassName = "de.jottyfan.camporganizer.Main"
|
mainClassName = "de.jottyfan.camporganizer.Main"
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
package de.jottyfan.camporganizer;
|
package de.jottyfan.camporganizer;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
@ -14,12 +19,20 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@RestController
|
@RestController
|
||||||
public class Main extends SpringBootServletInitializer {
|
public class Main extends SpringBootServletInitializer {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LogManager.getLogger(Main.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder appication) {
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||||
return appication.sources(Main.class);
|
return application.sources(Main.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
Path path = Paths.get("");
|
||||||
|
String p = path.toAbsolutePath().toString();
|
||||||
|
p = p.substring(p.lastIndexOf("/") + 1);
|
||||||
|
LOGGER.info("running in {}", p);
|
||||||
|
// TODO: put p + "properties" somehow into consideration to load the application.properties
|
||||||
SpringApplication.run(Main.class, args);
|
SpringApplication.run(Main.class, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,15 @@ public class BookingsController {
|
|||||||
|
|
||||||
@PostMapping("/business/bookings/payment/{id}")
|
@PostMapping("/business/bookings/payment/{id}")
|
||||||
@RolesAllowed({"business_booking"})
|
@RolesAllowed({"business_booking"})
|
||||||
public String addBooking(Model model, @ModelAttribute AddPaymentBean bean, @PathVariable Integer id, @RequestParam String search) {
|
public String addPayment(Model model, @ModelAttribute AddPaymentBean bean, @PathVariable Integer id) {
|
||||||
|
Double payment = bean.getPayment();
|
||||||
|
bookingsService.addPayment(id, payment);
|
||||||
|
return getBooking(model, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/business/bookings/listpayment/{id}")
|
||||||
|
@RolesAllowed({"business_booking"})
|
||||||
|
public String addListPayment(Model model, @ModelAttribute AddPaymentBean bean, @PathVariable Integer id, @RequestParam(defaultValue = "") String search) {
|
||||||
Double payment = bean.getPayment();
|
Double payment = bean.getPayment();
|
||||||
bookingsService.addPayment(id, payment);
|
bookingsService.addPayment(id, payment);
|
||||||
LOGGER.debug("search is {}", search);
|
LOGGER.debug("search is {}", search);
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<td class="middled" th:text="${b.camp}"></td>
|
<td class="middled" th:text="${b.camp}"></td>
|
||||||
<td class="middled" th:text="${b.role}"></td>
|
<td class="middled" th:text="${b.role}"></td>
|
||||||
<td class="middled">
|
<td class="middled">
|
||||||
<form action="#" th:action="@{'/business/bookings/payment/' + ${b.pk}}" th:object="${addBean}" method="post">
|
<form action="#" th:action="@{'/business/bookings/listpayment/' + ${b.pk}}" th:object="${addBean}" method="post">
|
||||||
<input th:id="'searchfield' + ${b.pk}" type="hidden" th:name="search" />
|
<input th:id="'searchfield' + ${b.pk}" type="hidden" th:name="search" />
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user