Skip to content
Snippets Groups Projects
Commit adcfb3cc authored by Erik Borgeteien Hansen's avatar Erik Borgeteien Hansen
Browse files

add admin check method on mount

parent abf79e0b
No related branches found
No related tags found
2 merge requests!87Community request,!86Community admin
...@@ -39,19 +39,19 @@ ...@@ -39,19 +39,19 @@
<script> <script>
import { LeaveCommunity } from "@/utils/apiutil"; import { LeaveCommunity } from "@/utils/apiutil";
import CommunityAdminService from "@/services/community-admin.service";
export default { export default {
name: "CommunityHamburger", name: "CommunityHamburger",
props: { props: {
communityID: Number, communityID: Number,
admin: Boolean,
}, },
data() { data() {
return { return {
id: -1, id: -1,
admin: false,
}; };
}, },
methods: { methods: {
leaveCommunity: async function () { leaveCommunity: async function () {
this.id = await this.$router.currentRoute.value.params.communityID; this.id = await this.$router.currentRoute.value.params.communityID;
...@@ -59,5 +59,8 @@ export default { ...@@ -59,5 +59,8 @@ export default {
this.$router.push("/"); this.$router.push("/");
}, },
}, },
mounted() {
this.admin = CommunityAdminService.isUserAdmin();
},
}; };
</script> </script>
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