diff --git a/src/services/community-admin.service.js b/src/services/community-admin.service.js index 1fc9bddc3ca6848712252b36e29eb628a6b15558..81f1581dd2f2903fe609a4ee41a62fdc1b7c900e 100644 --- a/src/services/community-admin.service.js +++ b/src/services/community-admin.service.js @@ -7,6 +7,22 @@ const API_URL = process.env.VUE_APP_BASEURL; * Service class acting as a middle layer between our components and the API */ class CommunityAdminService { + async isUserAdmin() { + return await axios + .get( + API_URL + + "communities/" + + this.$route.params.communityID + + "/user/admin", + { + headers: tokenHeader(), + } + ) + .then((res) => { + return res.data; + }); + } + //TODO acceptUserIntoCommunity() {} @@ -26,7 +42,9 @@ class CommunityAdminService { async deleteCommunity(communityId) { return await axios.post( API_URL + "communities/" + communityId + "/remove", - tokenHeader + { + headers: tokenHeader(), + } ); } }