diff --git a/src/components/CommunityComponents/CommunitySettings.vue b/src/components/CommunityComponents/CommunitySettings.vue index 8ea68e5261329fb85624ce68a201be8e02273416..eade2eeb081e0f08e491aa6b723e926418de70cb 100644 --- a/src/components/CommunityComponents/CommunitySettings.vue +++ b/src/components/CommunityComponents/CommunitySettings.vue @@ -9,7 +9,7 @@ </template> <script> -// import CommunityAdminService from "@/services/community-admin.service"; +import CommunityAdminService from "@/services/community-admin.service"; import IconButton from "@/components/BaseComponents/IconButton.vue"; //TODO: OPEN CONFIRMATION DIALOG WHEN DELETING @@ -19,9 +19,12 @@ export default { IconButton, }, methods: { - deleteCommunity() { - console.log("DELETED"); - // CommunityAdminService.deleteCommunity(this.$route.params.communityID); + async deleteCommunity() { + let response = await CommunityAdminService.deleteCommunity( + this.$route.params.communityID + ); + if (response.status === 200) + this.$router.push({ name: "home", replace: true }); }, }, }; diff --git a/src/services/community-admin.service.js b/src/services/community-admin.service.js index c935f1181ea5d8c81306dddae21a8015d95a8d9d..eb2c23e00d5d3ca456f5685429dc5d0393d01047 100644 --- a/src/services/community-admin.service.js +++ b/src/services/community-admin.service.js @@ -60,7 +60,7 @@ class CommunityAdminService { * @returns TODO */ async deleteCommunity(communityID) { - return await axios.post( + return await axios.delete( API_URL + "communities/" + communityID + "/remove", { headers: tokenHeader(),