Skip to content
Snippets Groups Projects
Commit 37b5d8c6 authored by Axel Po's avatar Axel Po
Browse files

feat: delete product

parent 7aa700d9
Branches
2 merge requests!6Dev,!5Feat/admin
......@@ -2,7 +2,7 @@
<h1 class="text-5xl">Erreur !</h1>
<p class="text-red-500 mt-6">{{ errorMessage }}</p>
<a
href="{{ path('app_product_index_admin') }}"
href="{{ path('app_category_index') }}"
class="inline-block mt-12 text-center bg-red-500 text-white py-2 px-6 rounded-md"
>Ok</a
>
......
......@@ -38,7 +38,7 @@
<p class="md:ml-12">{{ product.category.getName() }}</p>
</div>
<div class="mt-6 md:m-0">
<div class="flex gap-[20px] mt-6 md:m-0">
<a
class="text-white bg-gray-400 py-2 px-6 rounded-md"
href="{{ path('app_product_show', { id: product.id }) }}"
......@@ -49,11 +49,12 @@
href="{{ path('app_product_edit', { id: product.id }) }}"
>Modifier</a
>
<a
class="bg-red-400 text-white py-2 px-6 rounded-md"
href="{{ path('app_product_delete', { id: product.id }) }}"
>Supprimer</a
>
<form action="{{ path('app_product_delete', { id: product.id }) }}" method="POST">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ product.id) }}">
<button type="submit" class="bg-red-400 text-white py-2 px-6 rounded-md">Supprimer</button>
</form>
</div>
</article>
{% else %}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment