Skip to content

Commit

Permalink
fix: 권한 변경 페이지 변수 변경 (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
selfishAltruism committed Mar 7, 2024
1 parent 1ed5eb5 commit d7fc7f5
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions src/@types/user.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@ declare namespace User {

// findPrivilegedUsers
export interface FindPrivilegedUsersResponseDto {
presidentUsers: UserDto[];
vicePresidentUsers: UserDto[];
presidentUser: UserDto[];
vicePresidentUser: UserDto[];
councilUsers: UserDto[];
leaderGradeUsers: UserDto[];
leaderCircleUsers: UserDto[];
leaderAlumni: UserDto[];
}

export interface FindPrivilegedUsersResponse {
presidentUsers: Model.User[];
vicePresidentUsers: Model.User[];
presidentUser: Model.User[];
vicePresidentUser: Model.User[];
councilUsers: Model.User[];
leaderGradeUsers: Model.User[];
leaderCircleUsers: Model.User[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const PermissionManagementPage: React.FC = observer(() => {
fetch();
return () => reset();
}, []);

return (
<>
<Header mini title="권한 관리" withBack={PAGE_URL.Setting} RightComponent={null} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { UserRepoImpl as Repo } from '@/stores/repositories/UserRepo';
export type listKey = 'councilUsers' | 'leaderGradeUsers' | 'leaderCircleUsers';

export class SettingRoleManagementPageUiStore implements WithUserInfoModalUi {
presidentUsers: Model.User[] = [];
vicePresidentUsers: Model.User[] = [];
presidentUser: Model.User[] = [];
vicePresidentUser: Model.User[] = [];
councilUsers: Model.User[] = [];
leaderGradeUsers: Model.User[] = [];
leaderCircleUsers: Model.User[] = [];
Expand All @@ -34,8 +34,8 @@ export class SettingRoleManagementPageUiStore implements WithUserInfoModalUi {
}

reset(): void {
this.presidentUsers = [];
this.vicePresidentUsers = [];
this.presidentUser = [];
this.vicePresidentUser = [];
this.councilUsers = [];
this.leaderGradeUsers = [];
this.leaderCircleUsers = [];
Expand All @@ -44,16 +44,15 @@ export class SettingRoleManagementPageUiStore implements WithUserInfoModalUi {

*fetch(): Generator {
const {
presidentUsers,
vicePresidentUsers,
presidentUser,
vicePresidentUser,
councilUsers,
leaderAlumni,
leaderCircleUsers,
leaderGradeUsers,
} = (yield Repo.findPrivilegedUsers()) as unknown as User.FindPrivilegedUsersResponse;

this.presidentUsers = presidentUsers;
this.vicePresidentUsers = vicePresidentUsers;
this.presidentUser = presidentUser;
this.vicePresidentUser = vicePresidentUser;
this.councilUsers = councilUsers;
this.leaderGradeUsers = leaderGradeUsers;
this.leaderCircleUsers = leaderCircleUsers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { Box, Row, Title, UserName } from './styled';
import { usePageUiStore } from '@/hooks';

export const PresidentUsers: React.FC = observer(() => {
const { presidentUsers } = usePageUiStore<PageUiStore.SettingRoleManagement>();
const { presidentUser } = usePageUiStore<PageUiStore.SettingRoleManagement>();

return (
<Box>
<Title>학생회장</Title>
{presidentUsers[0] ? (
{presidentUser[0] ? (
<Row>
<UserName model={presidentUsers[0]} />
<UserName model={presidentUser[0]} />
</Row>
) : null}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { PAGE_URL } from '@/configs/path';
import { usePageUiStore } from '@/hooks';

export const VicePresidentUsers: React.FC = observer(() => {
const { vicePresidentUsers } = usePageUiStore<PageUiStore.SettingRoleManagement>();
const { vicePresidentUser } = usePageUiStore<PageUiStore.SettingRoleManagement>();

return (
<Box>
<ChangeLink pathname={PAGE_URL.SettingRoleVicePresident} />
<Title>부학생회장</Title>
{vicePresidentUsers[0] ? (
{vicePresidentUser[0] ? (
<Row>
<UserName model={vicePresidentUsers[0]} />
<UserName model={vicePresidentUser[0]} />
</Row>
) : null}
</Box>
Expand Down
8 changes: 4 additions & 4 deletions src/stores/repositories/UserRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class UserRepo {
findPrivilegedUsers = async (): Promise<User.FindPrivilegedUsersResponse> => {
const {
data: {
presidentUsers,
vicePresidentUsers,
presidentUser,
vicePresidentUser,
councilUsers,
leaderAlumni,
leaderCircleUsers,
Expand All @@ -94,8 +94,8 @@ class UserRepo {
} = await axios.get<User.FindPrivilegedUsersResponseDto>(`${this.URI}/privileged`); */

return {
presidentUsers: presidentUsers.map(user => new UserModel(user)),
vicePresidentUsers: vicePresidentUsers.map(user => new UserModel(user)),
presidentUser: presidentUser.map(user => new UserModel(user)),
vicePresidentUser: vicePresidentUser.map(user => new UserModel(user)),
councilUsers: councilUsers.map(user => new UserModel(user)),
leaderGradeUsers: leaderGradeUsers.map(user => new UserModel(user)),
leaderCircleUsers: leaderCircleUsers.map(user => new UserModel(user)),
Expand Down

0 comments on commit d7fc7f5

Please sign in to comment.