From adcfb3cc65dfc44a15df43137990ca13ef531ff0 Mon Sep 17 00:00:00 2001 From: Erik Borgeteien Hansen <erik@erikbhan.no> Date: Tue, 3 May 2022 08:56:05 +0200 Subject: [PATCH] add admin check method on mount --- src/components/CommunityComponents/CommunityHamburger.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/CommunityComponents/CommunityHamburger.vue b/src/components/CommunityComponents/CommunityHamburger.vue index 1e0503a..c53a4d7 100644 --- a/src/components/CommunityComponents/CommunityHamburger.vue +++ b/src/components/CommunityComponents/CommunityHamburger.vue @@ -39,19 +39,19 @@ <script> import { LeaveCommunity } from "@/utils/apiutil"; +import CommunityAdminService from "@/services/community-admin.service"; export default { name: "CommunityHamburger", props: { communityID: Number, - admin: Boolean, }, data() { return { id: -1, + admin: false, }; }, - methods: { leaveCommunity: async function () { this.id = await this.$router.currentRoute.value.params.communityID; @@ -59,5 +59,8 @@ export default { this.$router.push("/"); }, }, + mounted() { + this.admin = CommunityAdminService.isUserAdmin(); + }, }; </script> -- GitLab