Skip to content
Snippets Groups Projects
Commit 3207eed3 authored by Titus Netland's avatar Titus Netland
Browse files

Merge branch 'delete-community' into 'main'

Delete community

See merge request !142
parents fde08002 8c5813cf
No related branches found
No related tags found
1 merge request!142Delete community
Pipeline #181941 failed
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</template> </template>
<script> <script>
// import CommunityAdminService from "@/services/community-admin.service"; import CommunityAdminService from "@/services/community-admin.service";
import IconButton from "@/components/BaseComponents/IconButton.vue"; import IconButton from "@/components/BaseComponents/IconButton.vue";
//TODO: OPEN CONFIRMATION DIALOG WHEN DELETING //TODO: OPEN CONFIRMATION DIALOG WHEN DELETING
...@@ -19,9 +19,12 @@ export default { ...@@ -19,9 +19,12 @@ export default {
IconButton, IconButton,
}, },
methods: { methods: {
deleteCommunity() { async deleteCommunity() {
console.log("DELETED"); let response = await CommunityAdminService.deleteCommunity(
// CommunityAdminService.deleteCommunity(this.$route.params.communityID); this.$route.params.communityID
);
if (response.status === 200)
this.$router.push({ name: "home", replace: true });
}, },
}, },
}; };
......
...@@ -60,7 +60,7 @@ class CommunityAdminService { ...@@ -60,7 +60,7 @@ class CommunityAdminService {
* @returns TODO * @returns TODO
*/ */
async deleteCommunity(communityID) { async deleteCommunity(communityID) {
return await axios.post( return await axios.delete(
API_URL + "communities/" + communityID + "/remove", API_URL + "communities/" + communityID + "/remove",
{ {
headers: tokenHeader(), headers: tokenHeader(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment