some refactoring, fixed addEmployeeModal, played with scss

This commit is contained in:
Sockenklaus
2021-11-12 01:16:32 +01:00
parent 9334b1fa26
commit 8204135b0f
6 changed files with 39 additions and 44 deletions

View File

@@ -3,20 +3,6 @@ import axios from '@/axios'
import { useUser } from './user'
import { useNotifications } from './notifications'
type ResultData = {
id: number,
firstName: string,
lastName: string | undefined,
shorthand: string,
phone: string | undefined,
mobile: string | undefined,
email: string | undefined,
contractHours: number,
isActive: boolean,
username: string | undefined,
role: string
}
const user = useUser()
const notifications = useNotifications()
@@ -26,6 +12,7 @@ export const useEmployee = defineStore({
state: () => {
return {
clean: {
/** @type Employee */
employee: {
id: NaN,
firstName: '',
@@ -42,6 +29,7 @@ export const useEmployee = defineStore({
},
},
/** @type Employee */
employee: {
id: NaN,
firstName: '',
@@ -72,7 +60,7 @@ export const useEmployee = defineStore({
this.$reset()
try {
const data : ResultData = await <ResultData>(await axios.get('employees/'+id, {
const data : Employee = await <Employee>(await axios.get('employees/'+id, {
headers: user.header
})).data