Some refactoring, added dynamic route for EmployeesDetails

This commit is contained in:
Sockenklaus
2021-10-29 17:06:54 +02:00
parent 6cb1f6b488
commit f04830edde
3 changed files with 8 additions and 5 deletions

View File

@@ -23,6 +23,7 @@ import { reactive, onMounted } from 'vue'
import { useUser } from '@/stores/user';
import axios from 'axios'
import { useNotifications } from '@/stores/notifications';
import { useRoute } from 'vue-router';
const userStore = useUser()
const useNotification = useNotifications()
@@ -61,7 +62,9 @@ onMounted(async () => {
})
try {
const data : ResultData = await <ResultData>(await ai.get('employees/me')).data
const id = useRoute().params.id
const data : ResultData = await <ResultData>(await ai.get('employees/'+id)).data
Object.assign(employee, data.employee)
Object.assign(user, data.user)