Прокинут запрос с клиента на сервер для проверки связи с API

This commit is contained in:
Alex committed 2024-01-12 11:26:26 +03:00
1 parent 2e0a85c93c
commit bae4547681
4 files changed
+33 -10

No files matched your search

@@ -148,10 +148,10 @@
:title="x.name"
:value="x.name"
:href="x.link"
:disabled="x.path=='/securyty'"
:disabled="x.path==''"
:to="x.path"
color="navigation">
<!-- Чтобы сделать неактивным раздел безопасность, не забыть прописать путь до него в disabled для показа -->
<template v-slot:prepend>
<v-icon :icon="x.ico"/>
<v-tooltip
+2 -2
View File
@@ -61,7 +61,7 @@ const routes = [
name: 'LaborProtection',
component: () => import('@/views/LaborProtection.vue'),
meta:{
title:"Безопасность",
title:"Охрана труда",
ico: "mdi-pharmacy"
}
},
@@ -70,7 +70,7 @@ const routes = [
name: 'SecurityPage',
component: () => import('@/views/SecurityPage.vue'),
meta:{
title:"Охрана труда",
title:"Безопасность",
ico: "mdi-ticket"
}
},
+28 -4
View File
@@ -1,20 +1,44 @@
<template>
<v-row>
<v-row class="bg-red w-100">
<v-col
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
>
Безопасность
<!-- Безопасность -->
</v-col>
</v-row>
<v-container class="bg-green">
{{ safetyData }}
</v-container>
</template>
<script>
import { ref } from 'vue';
import {pagecounter} from '@/utils/universal_functions'
import { axiosApiInstance } from '@/utils/axios-api';
export default {
setup(){
setup() {
pagecounter()
}
const safetyData = ref([])
const safety = () => {
axiosApiInstance.get(`api/safety/files/`).then(result => {
safetyData.value = result.data
})
}
// console.log('Должно прийти с сервера хоть что-то' ,safetyData)
return {
safetyData,
safety
}
}
}
</script>
+1 -2
View File
@@ -10,6 +10,5 @@ class SafetyFileAPIView(APIView):
all_file = SafetyFile.objects.all()
serializer_for_file = SafetyFileSerializer(instance=all_file, many=True)
# print(serializer_for_file)
return Response({'Файлы': serializer_for_file})
return Response({'safety_files': serializer_for_file.data})