mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-07-19 21:04:36 +02:00
Remove unused parameter in InventoryController
This was introduced in 6bd1c23e2d
.
This commit is contained in:
parent
8a084b1f2e
commit
c398c12592
|
@ -27,7 +27,7 @@ package catering {
|
|||
+ InventoryController(inventory : UniqueInventory)
|
||||
+ list(model : Model) : String
|
||||
+ edit(model : Model, pid : Product) : String
|
||||
+ edit(model : Model, pid : Product, form : InventoryMutateForm) : String
|
||||
+ edit(model : Model, form : InventoryMutateForm) : String
|
||||
+ edit(form : InventoryMutateForm, result : Errors, pid : Product, model : Model) : String
|
||||
+ add(model : Model) : String
|
||||
+ add(model : Model, form : InventoryMutateForm) : String
|
||||
|
|
|
@ -66,7 +66,7 @@ class InventoryController {
|
|||
String edit(Model model, @PathVariable Product pid) {
|
||||
CatalogDummy product = (CatalogDummy) pid;
|
||||
UniqueInventoryItem item = inventory.findByProduct(pid).get();
|
||||
return edit(model, pid,
|
||||
return edit(model,
|
||||
new InventoryMutateForm(product.getType(),
|
||||
product.getName(),
|
||||
item.getQuantity(),
|
||||
|
@ -77,7 +77,7 @@ class InventoryController {
|
|||
.map(NumberValue::doubleValueExact)));
|
||||
}
|
||||
|
||||
String edit(Model model, @PathVariable Product pid, InventoryMutateForm form) {
|
||||
String edit(Model model, InventoryMutateForm form) {
|
||||
model.addAttribute("actionIsAdd", false);
|
||||
model.addAttribute("form", form);
|
||||
|
||||
|
@ -86,9 +86,10 @@ class InventoryController {
|
|||
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
@PostMapping("/inventory/edit/{pid}")
|
||||
String edit(@Valid @ModelAttribute("form") InventoryMutateForm form, Errors result, @PathVariable Product pid, Model model) {
|
||||
String edit(@Valid @ModelAttribute("form") InventoryMutateForm form, Errors result, @PathVariable Product pid,
|
||||
Model model) {
|
||||
if (result.hasErrors()) {
|
||||
return edit(model, pid, form);
|
||||
return edit(model, form);
|
||||
}
|
||||
CatalogDummy product = (CatalogDummy) pid;
|
||||
UniqueInventoryItem item = inventory.findByProduct(pid).get();
|
||||
|
|
Loading…
Reference in a new issue