Skip to content

Commit 2a8aeb8

Browse files
committed
#115 [REFACTOR] 세팅페이지 API 변수명 통일
1 parent d4e697f commit 2a8aeb8

14 files changed

Lines changed: 101 additions & 93 deletions

src/apis/setting/useGetMyProfile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { axiosInstance } from '../axios';
2-
import type { MyProfile } from '../../types/setting';
2+
import type { MyProfileResponse } from '../../types/setting';
33
import { useQuery } from '@tanstack/react-query';
44
import { queryKey } from '../../constants/queryKey';
55

66
// 설정 - 나의 프로필 조회
7-
const getMyProfile = async (): Promise<MyProfile> => {
7+
const getMyProfile = async (): Promise<MyProfileResponse> => {
88
try {
99
const response = await axiosInstance.get('/api/workspace/setting/my-profile');
1010
return response.data.result;

src/apis/setting/useGetWorkspaceProfile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { Workspace } from '../../types/setting';
1+
import type { WorkspaceResponse } from '../../types/setting';
22
import { axiosInstance } from '../axios';
33
import { useQuery } from '@tanstack/react-query';
44
import { queryKey } from '../../constants/queryKey';
55

66
// 설정 - 워크스페이스 프로필 조회
7-
const getWorkspaceProfile = async (): Promise<Workspace> => {
7+
const getWorkspaceProfile = async (): Promise<WorkspaceResponse> => {
88
try {
99
const response = await axiosInstance.get('/api/workspace/setting/profile');
1010
return response.data.result;

src/apis/setting/usePatchMyProfileImage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { axiosInstance } from '../axios';
2-
import type { MyProfileImage } from '../../types/setting';
2+
import type { MyProfileImageResponse } from '../../types/setting';
33
import { useMutation } from '@tanstack/react-query';
44
import queryClient from '../../utils/queryClient';
55
import { queryKey } from '../../constants/queryKey';
66

77
// 설정 - 나의 프로필 이미지 변경
8-
const patchMyProfileImage = async (formData: FormData): Promise<MyProfileImage> => {
8+
const patchMyProfileImage = async (formData: FormData): Promise<MyProfileImageResponse> => {
99
try {
1010
const response = await axiosInstance.patch(
1111
'/api/workspace/setting/my-profile/profileImage',

src/components/Sidebar/FullSidebarContent.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import hamburgerIcon from '../../assets/icons/hamburger.svg';
1616
import SortableDropdownList from './SortableDropdownList';
1717
import vecocirclewhite from '../../assets/logos/veco-circle-logo-bg-white.svg';
1818
// import { usePatchWorkspaceTeams } from '../../apis/setting/usePatchWorkspaceTeams';
19-
import type { Team } from './types';
19+
import type { Team } from '../../types/setting';
2020

2121
interface FullSidebarContentProps {
2222
setExpanded: (value: boolean) => void;
@@ -148,9 +148,11 @@ const FullSidebarContent = ({ setExpanded, teams }: FullSidebarContentProps) =>
148148
items={teams}
149149
renderContent={(team, { listeners, attributes }, isOverlay) => (
150150
<DropdownMenu
151-
headerTitle={team.name}
151+
headerTitle={team.teamName}
152152
initialOpen={!isOverlay}
153-
headerTeamIcon={<img src={team.profileUrl || vecocirclewhite} alt={team.name} />}
153+
headerTeamIcon={
154+
<img src={team.teamImageUrl || vecocirclewhite} alt={team.teamName} />
155+
}
154156
isNested={true}
155157
dragHandle={
156158
<button {...attributes} {...listeners} type="button" className="cursor-grab">

src/components/Sidebar/MiniSidebarContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import externalHoverIcon from '../../assets/icons/external-hover.svg';
1212
import DropdownMenu from './DropdownMenu';
1313
import SidebarItem from './SidebarItem';
1414
import SortableDropdownList from './SortableDropdownList';
15-
import type { Team } from './types';
15+
import type { Team } from '../../types/setting';
1616

1717
interface MiniSidebarContentProps {
1818
setExpanded: (value: boolean) => void;
@@ -116,7 +116,7 @@ const MiniSidebarContent = ({ setExpanded, teams }: MiniSidebarContentProps) =>
116116
<DropdownMenu
117117
headerTitle=""
118118
initialOpen={!isOverlay}
119-
headerTeamIcon={team.profileUrl}
119+
headerTeamIcon={team.teamImageUrl}
120120
isNested={true}
121121
>
122122
{!isOverlay && (

src/components/Sidebar/Sidebar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ const Sidebar = () => {
1313
const teams = [
1414
{
1515
teamId: 2,
16-
name: 'Team1',
17-
profileUrl: vecocirclewhite,
16+
teamName: 'Team1',
17+
teamImageUrl: vecocirclewhite,
1818
memberCount: 2,
1919
createdAt: '2025-01-01',
2020
},
2121
{
2222
teamId: 3,
23-
name: 'Team2',
24-
profileUrl: vecocirclewhite,
23+
teamName: 'Team2',
24+
teamImageUrl: vecocirclewhite,
2525
memberCount: 2,
2626
createdAt: '2025-01-01',
2727
},

src/components/Sidebar/SortableDropdownList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { SortableContext, arrayMove, verticalListSortingStrategy } from '@dnd-kit/sortable';
1212
import React, { useState } from 'react';
1313
import SortableDropdown from './SortableDropdown';
14-
import type { Team } from './types';
14+
import type { Team } from '../../types/setting';
1515

1616
interface SortableDropdownListProps {
1717
items: Team[];

src/components/Sidebar/types.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/pages/setting/SettingMember.tsx

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,51 @@ import MemberInviteModal from './components/modal/MemberInviteModal.tsx';
55

66
const DUMMY_MEMBERS = [
77
{
8-
id: 1,
9-
profileImage: 'https://avatars.githubusercontent.com/u/91470334?v=4',
8+
memberId: 1,
9+
profileImageUrl: 'https://avatars.githubusercontent.com/u/91470334?v=4',
1010
name: '이가을',
1111
email: 'gaeulzzang@gmail.com',
1212
teams: [
13-
{ id: 1, name: 'veco1', teamProfileImage: null },
13+
{ teamId: 1, teamName: 'veco1', teamImageUrl: null },
1414
{
15-
id: 2,
16-
name: 'veco2',
17-
teamProfileImage: 'https://avatars.githubusercontent.com/u/91470334?v=4',
15+
teamId: 2,
16+
teamName: 'veco2',
17+
teamImageUrl: 'https://avatars.githubusercontent.com/u/91470334?v=4',
1818
},
1919
],
20-
date: '25.01.01',
20+
joinedAt: '25.01.01',
2121
},
2222
{
23-
id: 2,
24-
profileImage: null,
23+
memberId: 2,
24+
profileImageUrl: null,
2525
name: '선우정아',
2626
email: 'mymelody@naver.com',
2727
teams: [],
28-
date: '25.02.01',
28+
joinedAt: '25.02.01',
2929
},
3030
{
31-
id: 3,
32-
profileImage: null,
31+
memberId: 3,
32+
profileImageUrl: null,
3333
name: '가응가',
3434
email: 'gaeullee@gmail.com',
35-
teams: [{ id: 1, name: 'veco1', teamProfileImage: null }],
36-
date: '25.03.01',
35+
teams: [{ teamId: 1, teamName: 'veco1', teamImageUrl: null }],
36+
joinedAt: '25.03.01',
3737
},
3838
{
39-
id: 4,
40-
profileImage: null,
39+
memberId: 4,
40+
profileImageUrl: null,
4141
name: '가을리',
4242
email: 'gaeulzzang11@naver.com',
4343
teams: [
4444
{
45-
id: 1,
46-
name: 'veco1',
47-
teamProfileImage: 'https://avatars.githubusercontent.com/u/91470334?v=4',
45+
teamId: 1,
46+
teamName: 'veco1',
47+
teamImageUrl: 'https://avatars.githubusercontent.com/u/91470334?v=4',
4848
},
49-
{ id: 2, name: 'veco2', teamProfileImage: null },
50-
{ id: 3, name: 'veco3', teamProfileImage: null },
49+
{ teamId: 2, teamName: 'veco2', teamImageUrl: null },
50+
{ teamId: 3, teamName: 'veco3', teamImageUrl: null },
5151
],
52-
date: '25.04.01',
52+
joinedAt: '25.04.01',
5353
},
5454
];
5555

@@ -66,22 +66,22 @@ const SettingMember = () => {
6666
/>
6767
<hr className={`w-full text-gray-300`} />
6868
<MemberItem
69-
profileImage={DUMMY_MEMBERS[0].profileImage}
69+
profileImageUrl={DUMMY_MEMBERS[0].profileImageUrl}
7070
name={DUMMY_MEMBERS[0].name}
7171
email={DUMMY_MEMBERS[0].email}
7272
teams={DUMMY_MEMBERS[0].teams}
73-
date={DUMMY_MEMBERS[0].date}
73+
joinedAt={DUMMY_MEMBERS[0].joinedAt}
7474
className={`py-[2.4rem]`}
7575
/>
7676
<hr className={`w-full text-gray-300 mb-[2.4rem]`} />
7777
{DUMMY_MEMBERS.slice(1).map((member, index) => (
7878
<MemberItem
7979
key={index}
80-
profileImage={member.profileImage}
80+
profileImageUrl={member.profileImageUrl}
8181
name={member.name}
8282
email={member.email}
8383
teams={member.teams}
84-
date={member.date}
84+
joinedAt={member.joinedAt}
8585
className={`mb-[3.2rem]`}
8686
/>
8787
))}

src/pages/setting/SettingTeam.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ import TeamCreateModal from './components/modal/TeamCreateModal.tsx';
55

66
const DUMMY_TEAMS = [
77
{
8-
id: 1,
9-
profileImage: 'https://avatars.githubusercontent.com/u/91470334?v=4',
10-
name: 'Workspace',
8+
teamId: 1,
9+
teamImageUrl: 'https://avatars.githubusercontent.com/u/91470334?v=4',
10+
teamName: 'Workspace',
1111
memberCount: 10,
1212
createdAt: '25.01.01',
1313
},
1414
{
15-
id: 2,
16-
profileImage: null,
17-
name: 'Team A',
15+
teamId: 2,
16+
teamImageUrl: null,
17+
teamName: 'Team A',
1818
memberCount: 5,
1919
createdAt: '25.02.01',
2020
},
2121
{
22-
id: 3,
23-
profileImage: null,
24-
name: 'Team B',
22+
teamId: 3,
23+
teamImageUrl: null,
24+
teamName: 'Team B',
2525
memberCount: 8,
2626
createdAt: '25.03.01',
2727
},
2828
{
29-
id: 4,
30-
profileImage: null,
31-
name: 'Team C',
29+
teamId: 4,
30+
teamImageUrl: null,
31+
teamName: 'Team C',
3232
memberCount: 3,
3333
createdAt: '25.04.01',
3434
},
@@ -47,18 +47,18 @@ const SettingTeam = () => {
4747
/>
4848
<hr className={`w-full text-gray-300`} />
4949
<TeamItem
50-
profileImage={DUMMY_TEAMS[0].profileImage}
51-
name={DUMMY_TEAMS[0].name}
50+
teamImageUrl={DUMMY_TEAMS[0].teamImageUrl}
51+
teamName={DUMMY_TEAMS[0].teamName}
5252
memberCount={DUMMY_TEAMS[0].memberCount}
5353
createdAt={DUMMY_TEAMS[0].createdAt}
5454
className={`py-[2.4rem]`}
5555
/>
5656
<hr className={`w-full text-gray-300 mb-[2.4rem]`} />
5757
{DUMMY_TEAMS.slice(1).map((team, index) => (
5858
<TeamItem
59-
profileImage={team.profileImage}
59+
teamImageUrl={team.teamImageUrl}
6060
key={index}
61-
name={team.name}
61+
teamName={team.teamName}
6262
memberCount={team.memberCount}
6363
createdAt={team.createdAt}
6464
className={`mb-[3.2rem]`}

0 commit comments

Comments
 (0)