fix(phase26): add Pi trip deletion (BUG-08)
This commit is contained in:
@@ -182,6 +182,7 @@
|
||||
|
||||
const tripList = document.getElementById("trip-list");
|
||||
const deletable = tripList && tripList.dataset.deletable === "1";
|
||||
const deleteUrl = (tripList && tripList.dataset.deleteUrl) || "/api/trip/";
|
||||
|
||||
function renderTrips(trips) {
|
||||
body.replaceChildren();
|
||||
@@ -225,7 +226,7 @@
|
||||
window.confirmDelete(`Delete trip from ${date}?\n\nThe raw GPS data is kept — only this computed trip record is removed.`)
|
||||
.then(function(confirmed) {
|
||||
if (!confirmed) return;
|
||||
return fetch(`/api/v1/portal/trip/${tripId}`, { method: "DELETE" })
|
||||
return fetch(deleteUrl + tripId, { method: "DELETE" })
|
||||
.then(function(res) {
|
||||
if (!res.ok) throw new Error("Delete failed");
|
||||
deleteBtn.closest("tr").remove();
|
||||
|
||||
Reference in New Issue
Block a user