parent
7ff1d50079
commit
c4acf774ec
@ -5,7 +5,10 @@
|
||||
import Toastify from "toastify-js";
|
||||
import PromiseError from "../base/PromiseError.svelte";
|
||||
import { edit } from "marked/src/helpers";
|
||||
import ConfirmScanStationDeletion from "./ConfirmScanStationDeletion.svelte";
|
||||
let data_loaded = false;
|
||||
let modal_open;
|
||||
let delete_station;
|
||||
export let params;
|
||||
$: delete_triggered = false;
|
||||
$: original_data = {};
|
||||
@ -47,15 +50,23 @@
|
||||
}
|
||||
}
|
||||
function deleteStation() {
|
||||
// TODO:
|
||||
// GroupContactService.groupContactControllerRemove(original_data.id, true)
|
||||
// .then((resp) => {
|
||||
// location.replace("./");
|
||||
// })
|
||||
// .catch((err) => {});
|
||||
ScanStationService.scanStationControllerRemove(original_data.id, false)
|
||||
.then((resp) => {
|
||||
Toastify({
|
||||
text: "Station deleted",
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
location.replace("./");
|
||||
})
|
||||
.catch((err) => {
|
||||
modal_open = true;
|
||||
delete_station = original_data;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<ConfirmScanStationDeletion bind:modal_open bind:delete_station />
|
||||
{#await promise}
|
||||
Loading station details
|
||||
{:then}
|
||||
|
Loading…
x
Reference in New Issue
Block a user