diff --git a/wtnt/user/profile/service.py b/wtnt/user/profile/service.py index b373a40..b4c505d 100644 --- a/wtnt/user/profile/service.py +++ b/wtnt/user/profile/service.py @@ -182,6 +182,15 @@ def get_like_activity(self): return data + def get_not_approved_team(self): + owner_id = self.request.user.id + team_data = Team.objects.filter(leader_id=owner_id, is_approved=False) + serializer = TeamListSerializer(team_data, many=True) + + data = TeamResponse.get_team_list_response(serializer.data, owner_id) + + return data + class MyTeamManageService(BaseServiceWithCheckOwnership, BaseServiceWithCheckLeader): def get_my_teams(self): diff --git a/wtnt/user/profile/urls.py b/wtnt/user/profile/urls.py index 89d7d1a..9c125b3 100644 --- a/wtnt/user/profile/urls.py +++ b/wtnt/user/profile/urls.py @@ -7,6 +7,7 @@ UserManageActivityView, UserManageActivityDetailView, UserLikeTeamView, + NotApprovedTeamView, ) urlpatterns = [ @@ -17,4 +18,5 @@ path("team-manage/", UserManageActivityView.as_view(), name="profile-team-manage"), path("like/", UserLikeTeamView.as_view(), name="like-team-list"), path("team-manage/detail/", UserManageActivityDetailView.as_view(), name="profile-team-manage-detail"), + path("/not-approved", NotApprovedTeamView.as_view(), name="not-approved-team"), ] diff --git a/wtnt/user/profile/views.py b/wtnt/user/profile/views.py index 7c009c1..bcec3a5 100644 --- a/wtnt/user/profile/views.py +++ b/wtnt/user/profile/views.py @@ -135,3 +135,14 @@ def get(self, request, *args, **kwargs): data = myactivity_service.get_like_activity() return Response({"team": data}, status=status.HTTP_200_OK) + + +class NotApprovedTeamView(APIView): + permission_classes = [IsApprovedUser] + + def get(self, request, *args, **kwargs): + myactivity_service = MyActivityServcie(request, **kwargs) + myactivity_service.check_ownership() + data = myactivity_service.get_not_approved_team() + + return Response({"team": data}, status=status.HTTP_200_OK)