chore: fix bug where entries were not saved, implemented deplete function
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
<p>{{ request.title }}</p>
|
||||
<div class="actions">
|
||||
<button onclick="showInfo({{ request | tojson | safe }})" class="info">Info</button>
|
||||
<button onclick="deleteEntry({{ request.id }})" class="delete-button">Delete</button>
|
||||
<button onclick="deleteEntry('{{ request.title | escape }}')" class="delete-button">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
@@ -111,10 +111,11 @@
|
||||
closeModal();
|
||||
}
|
||||
}
|
||||
function deleteEntry(entryId) {
|
||||
function deleteEntry(title) {
|
||||
console.log("Deleting entry with title:", title);
|
||||
fetch(`/delete`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ item: entryId }),
|
||||
body: JSON.stringify({ title: title }), // Send title as part of a JSON object
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user