Add product deletion
This commit is contained in:
parent
466a6a33f8
commit
b38019f04c
|
|
@ -17,7 +17,32 @@
|
|||
<div class="flex justify-center lg:justify-end items-center p-5 border-t border-slate-200/60 dark:border-darkmode-400">
|
||||
<a class="flex items-center text-primary mr-auto" href="javascript:;"> <i data-lucide="eye" class="w-4 h-4 mr-1"></i> {{price}} </a>
|
||||
<a class="flex items-center mr-3" href="/seller/product/update/{{id}}"> <i data-lucide="check-square" class="w-4 h-4 mr-1"></i> {{'product.edit'|_}} </a>
|
||||
<a class="flex items-center text-danger" href="javascript:;" data-tw-toggle="modal" data-tw-target="#delete-confirmation-modal"> <i data-lucide="trash-2" class="w-4 h-4 mr-1"></i> {{'product.delete'|_}} </a>
|
||||
<a class="flex items-center text-danger" onclick="deleteProduct('{{ id }}')"> <i data-lucide="trash-2" class="w-4 h-4 mr-1"></i> {{'product.delete'|_}} </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% put scripts %}
|
||||
<script>
|
||||
function deleteProduct(id){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://nurgul.com.tm/app/api/seller/delete/product/' + id,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function (data) {
|
||||
console.log("success");
|
||||
console.log(data);
|
||||
location.reload()
|
||||
},
|
||||
error: function (data) {
|
||||
console.log("error");
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endput %}
|
||||
|
|
|
|||
Loading…
Reference in New Issue