some refactoring, fixed addEmployeeModal, played with scss
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user