[UPDT] GEOFENCING: get method of setup feature of geofencing

This commit is contained in:
Horilla
2025-05-28 11:29:17 +05:30
parent 4a18c4b0d4
commit dc191a7262

View File

@@ -26,11 +26,8 @@ class GeoFencingSetupGetPostAPIView(APIView):
name="dispatch",
)
def get(self, request):
if request.user.is_superuser:
location = GeoFencing.objects.all()
else:
company = request.user.employee_get.get_company()
location = company.geo_fencing.all()
company = request.user.employee_get.get_company()
location = company.geo_fencing.all()
paginator = PageNumberPagination()
page = paginator.paginate_queryset(location, request)
serializer = GeoFencingSetupSerializer(page, many=True)