Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: #274 팀 가입 현황과 대기 현황 필터링이 반대로 설정된 문제 해결 #277

Merged
merged 4 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hooks/query/useTeamQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export function useReadTeams() {
},
});

const joinedTeamList = teamList.filter((team) => team.isPendingApproval === true);
const invitedTeamList = teamList.filter((team) => team.isPendingApproval === false);
const joinedTeamList = teamList.filter((team) => team.isPendingApproval === false);
const invitedTeamList = teamList.filter((team) => team.isPendingApproval === true);

return { joinedTeamList, invitedTeamList, teamList, isLoading, isError, error };
}
Expand Down
40 changes: 20 additions & 20 deletions src/mocks/mockData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,123 +327,123 @@ export const TEAM_USER_DUMMY: TeamUser[] = [
teamId: 1,
userId: 1,
roleId: 1,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 1,
userId: 3,
roleId: 2,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 1,
userId: 4,
roleId: 3,
isPendingApproval: false,
isPendingApproval: true,
},
{
teamId: 1,
userId: 8,
roleId: 3,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 1,
userId: 9,
roleId: 3,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 1,
userId: 11,
roleId: 3,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 1,
userId: 12,
roleId: 3,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 1,
userId: 13,
roleId: 3,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 1,
userId: 14,
roleId: 3,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 1,
userId: 15,
roleId: 3,
isPendingApproval: true,
isPendingApproval: false,
},
// 팀2 소속 유저 정보
{
teamId: 2,
userId: 1,
roleId: 2,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 2,
userId: 3,
roleId: 2,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 2,
userId: 4,
roleId: 1,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 2,
userId: 5,
roleId: 3,
isPendingApproval: false,
isPendingApproval: true,
},
{
teamId: 2,
userId: 7,
roleId: 3,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 2,
userId: 10,
roleId: 3,
isPendingApproval: true,
isPendingApproval: false,
},
// 팀3 소속 유저 정보
{
teamId: 3,
userId: 1,
roleId: 3,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 3,
userId: 2,
roleId: 3,
isPendingApproval: true,
isPendingApproval: false,
},
{
teamId: 3,
userId: 5,
roleId: 2,
isPendingApproval: false,
isPendingApproval: true,
},
{
teamId: 3,
userId: 6,
roleId: 1,
isPendingApproval: true,
isPendingApproval: false,
},
] as const;

Expand Down
10 changes: 4 additions & 6 deletions src/mocks/services/teamServiceHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const teamServiceHandler = [
teamId: newTeamId,
userId: coworker.userId,
roleId: role.roleId,
isPendingApproval: false,
isPendingApproval: true,
});
}
TEAM_USER_DUMMY.push(...validTeamUsers);
Expand All @@ -99,7 +99,7 @@ const teamServiceHandler = [
teamId: newTeamId,
userId,
roleId: creatorRole.roleId,
isPendingApproval: true,
isPendingApproval: false,
});

return new HttpResponse(null, {
Expand Down Expand Up @@ -225,9 +225,7 @@ const teamServiceHandler = [
(teamUser) => teamUser.teamId === Number(teamId) && teamUser.userId === Number(userId),
);

if (teamUser) {
teamUser.isPendingApproval = true;
}
if (teamUser) teamUser.isPendingApproval = false;
return new HttpResponse(null, { status: 200 });
}),

Expand Down Expand Up @@ -321,7 +319,7 @@ const teamServiceHandler = [
teamId: Number(teamId),
userId: Number(userId),
roleId: role.roleId,
isPendingApproval: true,
isPendingApproval: false,
};

TEAM_USER_DUMMY.push(newUser);
Expand Down