Explorar o código

Fixed the demote user button

The button was showing only on admin user pages and to all users. Now it should only appear for admin users on all user accounts.
Owen Diffey %!s(int64=7) %!d(string=hai) anos
pai
achega
ff9a25cabb
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      frontend/components/User/Show.vue

+ 1 - 1
frontend/components/User/Show.vue

@@ -5,7 +5,7 @@
 			<img class="avatar" src="/assets/notes.png"/>
 			<h2 class="has-text-centered username">@{{user.username}}</h2>
 			<h5>A member since {{user.createdAt}}</h5>
-			<div class="admin-functionality" v-if="user.role == 'admin'">
+			<div class="admin-functionality" v-if="this.$parent.$parent.role === 'admin' == 'admin'">
 				<a class="button is-small is-info is-outlined" href='#' @click="changeRank('admin')" v-if="user.role == 'default'">Promote to Admin</a>
 				<a class="button is-small is-danger is-outlined" href='#' @click="changeRank('default')" v-else>Demote to User</a>
 			</div>