From c35dad29309756b50f747f61b95c01f68f4184c5 Mon Sep 17 00:00:00 2001 From: fnzksxl Date: Thu, 29 Aug 2024 05:02:17 +0900 Subject: [PATCH] =?UTF-8?q?#88=20Feat:=20=EB=AF=B8=EC=8A=B9=EC=9D=B8=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=EB=A7=8C=20=ED=99=95?= =?UTF-8?q?=EC=9D=B8=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8A=94=20API=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wtnt/user/profile/service.py | 9 +++++++++ wtnt/user/profile/urls.py | 2 ++ wtnt/user/profile/views.py | 11 +++++++++++ 3 files changed, 22 insertions(+) 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)