diff --git a/resources/views/admin/product/edit.blade.php b/resources/views/admin/product/edit.blade.php index 885e57f..1ce5ad8 100755 --- a/resources/views/admin/product/edit.blade.php +++ b/resources/views/admin/product/edit.blade.php @@ -228,6 +228,17 @@ updateRecipeTotal(); }); + // Löschen gespeicherter Inhaltsstoffe: eigenes Formular außerhalb des + // Produkt-Formulars, damit _method=DELETE nicht ins Speichern leakt. + $(document).on('click', '.js-ingredient-delete', function () { + var $btn = $(this); + if (!confirm($btn.data('confirm'))) return; + $('
', { method: 'post', action: $btn.data('action') }) + .append($('', { type: 'hidden', name: '_token', value: $('meta[name="csrf-token"]').attr('content') })) + .append($('', { type: 'hidden', name: '_method', value: 'DELETE' })) + .appendTo('body')[0].submit(); + }); + $(document).on('input change', '.pi-gram, .pi-factor', function () { updateEffective($(this).closest('tr')); updateRecipeTotal(); diff --git a/resources/views/admin/product/form.blade.php b/resources/views/admin/product/form.blade.php index 2c02b08..4ae7509 100755 --- a/resources/views/admin/product/form.blade.php +++ b/resources/views/admin/product/form.blade.php @@ -637,12 +637,13 @@ — @if ($product->id) - - @csrf - @method('DELETE') - -
+ {{-- Kein
hier: der Button liegt im Produkt-Formular, verschachtelte + Formulare würden _method=DELETE ins Speichern-Formular leaken. --}} + @else