|
|
|
@ -1,5 +1,16 @@ |
|
|
|
|
<script> |
|
|
|
|
let Data = new GetJson("/api/admin/table/{{ .Table }}/{{ .Id }}/"); |
|
|
|
|
|
|
|
|
|
const ConfirmDelete = async (table, obj_id) => { |
|
|
|
|
if(confirm("Are you sure?")) { |
|
|
|
|
await fetch("/api/admin/table/" + table + "/" + obj_id + "/", |
|
|
|
|
{ method: "DELETE" }); |
|
|
|
|
window.location = "/admin/table/" + table + "/"; |
|
|
|
|
} else { |
|
|
|
|
console.log("NOOOOO"); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<blockstart> |
|
|
|
@ -19,9 +30,9 @@ |
|
|
|
|
</middle> |
|
|
|
|
<bottom> |
|
|
|
|
<button-group> |
|
|
|
|
<button type="button">Back</button> |
|
|
|
|
<button type="button"><a href="/admin/table/{{ .Table }}/">Back</a></button> |
|
|
|
|
<button type="submit">Update</button> |
|
|
|
|
<button type="button" @click.prevent="console.log('DELETE', item.id)">Delete</button> |
|
|
|
|
<button type="button" @click.prevent="ConfirmDelete('{{ .Table }}', item.id)">Delete</button> |
|
|
|
|
</button-group> |
|
|
|
|
</bottom> |
|
|
|
|
</card> |
|
|
|
|