from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
# from rest_framework.pagination import PageNumberPagination
from rest_framework.exceptions import ValidationError, NotFound
from drf_yasg.utils import swagger_auto_schema
from django.shortcuts import get_object_or_404

from job_category_list.models.job_category import JobCategory
from job_category_list.serializer.category_dropdown_serializer import JobCategoryDropDownSerializer
# from common.pagination.custom_pagination import CustomPageNumberPagination
from common.exceptions.exceptions import custom_exception_handler


class JobCategoryDropDownListCreateAPIView(APIView):
    def get(self, request):
        categories = JobCategory.objects.all()
        serializer = JobCategoryDropDownSerializer(categories, many=True)
        return Response(serializer.data)