Skip to content

Commit

Permalink
Merge pull request #1739 from adnankattekaden/dev
Browse files Browse the repository at this point in the history
school list
  • Loading branch information
adnankattekaden authored Dec 5, 2023
2 parents be99f86 + 8fe16eb commit 16e77ee
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api/register/register_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,24 @@ def post(self, request):
).get_success_response()


class SchoolAPI(APIView):
def post(self, request):
org_queryset = Organization.objects.filter(
Q(org_type=OrganizationType.SCHOOL.value),
Q(district_id=request.data.get("district")),
)

college_serializer_data = serializers.OrgSerializer(
org_queryset, many=True
).data

return CustomResponse(
response={
"schools": college_serializer_data,
}
).get_success_response()


class CommunityAPI(APIView):
def get(self, request):
community_queryset = Organization.objects.filter(
Expand Down
1 change: 1 addition & 0 deletions api/register/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
path("college/list/", register_views.CollegeAPI.as_view()),
path("company/list/", register_views.CompanyAPI.as_view()),
path("community/list/", register_views.CommunityAPI.as_view()),
path("schools/list/", register_views.SchoolAPI.as_view()),
path("area-of-interest/list/", register_views.AreaOfInterestAPI.as_view()),
path("lc/user-validation/", register_views.LearningCircleUserViewAPI.as_view()),
path('email-verification/', register_views.UserEmailVerificationAPI.as_view()),
Expand Down

0 comments on commit 16e77ee

Please sign in to comment.