Quellcode durchsuchen

Fixed issue with deleting a station fro manage station modal

Kristian Vos vor 4 Jahren
Ursprung
Commit
be9f2171c2
1 geänderte Dateien mit 13 neuen und 1 gelöschten Zeilen
  1. 13 1
      frontend/src/components/modals/ManageStation/index.vue

+ 13 - 1
frontend/src/components/modals/ManageStation/index.vue

@@ -171,7 +171,7 @@
 				</confirm>
 				<confirm
 					v-if="station && station.type === 'community'"
-					@confirm="deleteStation()"
+					@confirm="removeStation()"
 				>
 					<button class="button is-danger">Delete station</button>
 				</confirm>
@@ -319,6 +319,18 @@ export default {
 		isOwnerOrAdmin() {
 			return this.isOwner() || this.isAdmin();
 		},
+		removeStation(index) {
+			this.socket.dispatch(
+				"stations.remove",
+				this.station._id,
+				res => {
+					new Toast(res.message);
+					if (res.status === "success") {
+						this.closeModal("manageStation");
+					}
+				}
+			);
+		},
 		resumeStation() {
 			this.socket.dispatch("stations.resume", this.station._id, res => {
 				if (res.status !== "success")