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)
|
+ InventoryController(inventory : UniqueInventory)
|
||||||
+ list(model : Model) : String
|
+ list(model : Model) : String
|
||||||
+ edit(model : Model, pid : Product) : 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
|
+ edit(form : InventoryMutateForm, result : Errors, pid : Product, model : Model) : String
|
||||||
+ add(model : Model) : String
|
+ add(model : Model) : String
|
||||||
+ add(model : Model, form : InventoryMutateForm) : String
|
+ add(model : Model, form : InventoryMutateForm) : String
|
||||||
|
|
|
@ -66,7 +66,7 @@ class InventoryController {
|
||||||
String edit(Model model, @PathVariable Product pid) {
|
String edit(Model model, @PathVariable Product pid) {
|
||||||
CatalogDummy product = (CatalogDummy) pid;
|
CatalogDummy product = (CatalogDummy) pid;
|
||||||
UniqueInventoryItem item = inventory.findByProduct(pid).get();
|
UniqueInventoryItem item = inventory.findByProduct(pid).get();
|
||||||
return edit(model, pid,
|
return edit(model,
|
||||||
new InventoryMutateForm(product.getType(),
|
new InventoryMutateForm(product.getType(),
|
||||||
product.getName(),
|
product.getName(),
|
||||||
item.getQuantity(),
|
item.getQuantity(),
|
||||||
|
@ -77,7 +77,7 @@ class InventoryController {
|
||||||
.map(NumberValue::doubleValueExact)));
|
.map(NumberValue::doubleValueExact)));
|
||||||
}
|
}
|
||||||
|
|
||||||
String edit(Model model, @PathVariable Product pid, InventoryMutateForm form) {
|
String edit(Model model, InventoryMutateForm form) {
|
||||||
model.addAttribute("actionIsAdd", false);
|
model.addAttribute("actionIsAdd", false);
|
||||||
model.addAttribute("form", form);
|
model.addAttribute("form", form);
|
||||||
|
|
||||||
|
@ -86,9 +86,10 @@ class InventoryController {
|
||||||
|
|
||||||
@PreAuthorize("hasRole('ADMIN')")
|
@PreAuthorize("hasRole('ADMIN')")
|
||||||
@PostMapping("/inventory/edit/{pid}")
|
@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()) {
|
if (result.hasErrors()) {
|
||||||
return edit(model, pid, form);
|
return edit(model, form);
|
||||||
}
|
}
|
||||||
CatalogDummy product = (CatalogDummy) pid;
|
CatalogDummy product = (CatalogDummy) pid;
|
||||||
UniqueInventoryItem item = inventory.findByProduct(pid).get();
|
UniqueInventoryItem item = inventory.findByProduct(pid).get();
|
||||||
|
|
Loading…
Reference in a new issue