This commit is contained in:
Nukeap committed 2024-06-06 16:00:04 +03:00
1 parent 069189a1dc
commit 0f8588fc0f
4 files changed
+19 -1

No files matched your search

@@ -2,6 +2,8 @@ from rest_framework import serializers
from .models import *
from about_inspection.models import *
from userauth.serializers import *
class IdonlynotRequieredSerializer(serializers.Serializer):
id = serializers.IntegerField(required=False)
class CalendarParticipantsSerializer(serializers.ModelSerializer):
""" Сериализатор участников календаря """
+1
View File
@@ -8,5 +8,6 @@ urlpatterns = [
path('get_employees/', GetEmployees.as_view(), name='get_employees'),
path('my_calendars/', MyCalendars.as_view(), name='get_calendars'),
path('exclusion_dates/', ExclusionDatesAPIView.as_view(), name='exclusion_dates'),
path('my_events/', MyEvents.as_view(), name='myvents')
# path('createEvents/', CreateEventsAPIView.as_view(), name='createEvents')
]
+13
View File
@@ -86,3 +86,16 @@ class GetEmployees(APIView):
return Response(EmployeeSerializer(queryset, many=True).data)
class MyEvents(APIView):
@swagger_auto_schema(query_serializer=IdonlynotRequieredSerializer)
def get(self, request):
eventid = request.query_params.get("id")
result = []
if eventid is None:
calendars = Calendar.objects.filter(Q(get_participants__participant_calendar__id=request.user.user.id) | Q(author__id=request.user.user.id)).distinct()
else:
pass
return Response(result)
+3 -1
View File
@@ -47,10 +47,12 @@ export const useAccountStore = defineStore("AccountStore", () => {
// геттер бывший
// const getUser=computed(()=> uyser.value)
function getuserFromStorage(){
try{
let u = VueJwtDecode.decode(localStorage.getItem("refresh"));
u.user.photo = checkremote(`${spravURL}${u.user.login}.jpg`);
return u.user;
}catch{
return {}}
}
const logging = async (anon) => {
AppStore.loading = true;