mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Починка админки полностью1д9l92в
This commit is contained in:
@@ -43,7 +43,7 @@ const router = createRouter({
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, _, next) => {
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
|
|
||||||
if (to.meta.requiresAdmin && !authStore.isAdmin) {
|
if (to.meta.requiresAdmin && !authStore.isAdmin) {
|
||||||
|
@@ -49,7 +49,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import { PlusCircle } from 'lucide-vue-next';
|
import { PlusCircle } from 'lucide-vue-next';
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
interface Employee {
|
interface Employee {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -59,7 +58,6 @@ interface Employee {
|
|||||||
office: string;
|
office: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const employees = ref<Employee[]>([]);
|
const employees = ref<Employee[]>([]);
|
||||||
|
|
||||||
const fetchEmployees = async () => {
|
const fetchEmployees = async () => {
|
||||||
@@ -77,10 +75,6 @@ const editEmployee = (employee: Employee) => {
|
|||||||
console.log('Edit employee:', employee);
|
console.log('Edit employee:', employee);
|
||||||
};
|
};
|
||||||
|
|
||||||
const addEmployee = () => {
|
|
||||||
router.push('/admin/employees/add');
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchEmployees();
|
fetchEmployees();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user