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

check if admin in state

parent b6c78496
No related branches found
No related tags found
1 merge request!128Admin page guard
......@@ -39,7 +39,6 @@
<script>
import { LeaveCommunity } from "@/utils/apiutil";
import CommunityAdminService from "@/services/community-admin.service";
export default {
name: "CommunityHamburger",
......@@ -57,13 +56,11 @@ export default {
this.$router.push("/");
},
},
async mounted() {
this.admin = await CommunityAdminService.isUserAdmin(
this.$route.params.communityID
);
},
created() {
this.communityID = this.$route.params.communityID;
this.admin = this.$store.state.user.adminList.includes(
parseInt(this.communityID)
);
},
};
</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