trying setup store

This commit is contained in:
Sockenklaus
2021-11-15 16:48:56 +01:00
parent cea22ed0ef
commit 174cb17b04
5 changed files with 103 additions and 20 deletions

View File

@@ -92,7 +92,7 @@
id="contract-hours"
class="form-control"
:class="classIsInvalid(v$.contractHours)"
:disabled="!editEmployee"
:disabled="!editEmployee || !user.isAdmin"
/>
<div v-for="(error) in v$.contractHours.$errors" class="invalid-feedback" id="contractHoursFeedback">
@@ -164,6 +164,7 @@
import VProfileControls from '@/components/VProfileControls.vue';
import { onMounted, computed, ref, watch } from 'vue'
import { useEmployee } from '@/stores/employee'
import { useUser } from '@/stores/user'
import { useRoute } from 'vue-router';
import { storeToRefs } from 'pinia';
import useVuelidate from '@vuelidate/core'
@@ -172,6 +173,7 @@ import { IMaskComponent as MaskInput } from 'vue-imask'
const route = useRoute()
const state = useEmployee()
const user = useUser()
const { employee } = storeToRefs(state)