P-70 fix
This commit is contained in:
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 .models import *
|
||||||
from about_inspection.models import *
|
from about_inspection.models import *
|
||||||
from userauth.serializers import *
|
from userauth.serializers import *
|
||||||
|
class IdonlynotRequieredSerializer(serializers.Serializer):
|
||||||
|
id = serializers.IntegerField(required=False)
|
||||||
|
|
||||||
class CalendarParticipantsSerializer(serializers.ModelSerializer):
|
class CalendarParticipantsSerializer(serializers.ModelSerializer):
|
||||||
""" Сериализатор участников календаря """
|
""" Сериализатор участников календаря """
|
||||||
|
|||||||
@@ -8,5 +8,6 @@ urlpatterns = [
|
|||||||
path('get_employees/', GetEmployees.as_view(), name='get_employees'),
|
path('get_employees/', GetEmployees.as_view(), name='get_employees'),
|
||||||
path('my_calendars/', MyCalendars.as_view(), name='get_calendars'),
|
path('my_calendars/', MyCalendars.as_view(), name='get_calendars'),
|
||||||
path('exclusion_dates/', ExclusionDatesAPIView.as_view(), name='exclusion_dates'),
|
path('exclusion_dates/', ExclusionDatesAPIView.as_view(), name='exclusion_dates'),
|
||||||
|
path('my_events/', MyEvents.as_view(), name='myvents')
|
||||||
# path('createEvents/', CreateEventsAPIView.as_view(), name='createEvents')
|
# path('createEvents/', CreateEventsAPIView.as_view(), name='createEvents')
|
||||||
]
|
]
|
||||||
@@ -86,3 +86,16 @@ class GetEmployees(APIView):
|
|||||||
return Response(EmployeeSerializer(queryset, many=True).data)
|
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)
|
||||||
@@ -47,10 +47,12 @@ export const useAccountStore = defineStore("AccountStore", () => {
|
|||||||
// геттер бывший
|
// геттер бывший
|
||||||
// const getUser=computed(()=> uyser.value)
|
// const getUser=computed(()=> uyser.value)
|
||||||
function getuserFromStorage(){
|
function getuserFromStorage(){
|
||||||
|
try{
|
||||||
let u = VueJwtDecode.decode(localStorage.getItem("refresh"));
|
let u = VueJwtDecode.decode(localStorage.getItem("refresh"));
|
||||||
u.user.photo = checkremote(`${spravURL}${u.user.login}.jpg`);
|
u.user.photo = checkremote(`${spravURL}${u.user.login}.jpg`);
|
||||||
return u.user;
|
return u.user;
|
||||||
|
}catch{
|
||||||
|
return {}}
|
||||||
}
|
}
|
||||||
const logging = async (anon) => {
|
const logging = async (anon) => {
|
||||||
AppStore.loading = true;
|
AppStore.loading = true;
|
||||||
|
|||||||
Reference in new issue
Block a user