Skip to content

Commit a43a8b9

Browse files
committed
refactor: 함수명 직관적으로 변경
getWorkspaces -> updateWorkspaces getWorkspacesAPI -> getWorkspaces Resolve: #20
1 parent 79a58f0 commit a43a8b9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

client/src/apis/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { baseRequest } from './util';
22

3-
export const getWorkspacesAPI = async (userId: number) => {
3+
export const getWorkspaces = async (userId: number) => {
44
try {
55
const { data } = await baseRequest.get(`/user/${userId}/workspace`);
66

client/src/components/WorkspaceList/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { memo, useEffect, useState } from 'react';
2-
import { getWorkspacesAPI } from 'src/apis/user';
2+
import { getWorkspaces } from 'src/apis/user';
33
import { Workspace } from 'src/types/workspace';
44

55
import AddButton from './AddButton';
@@ -17,13 +17,13 @@ function WorkspaceList({ onSelectModalOpen }: WorkspaceListProps) {
1717
*/
1818
const userId = 63814960;
1919

20-
const getWorkspaces = async (userId: number) => {
21-
const { workspaces } = await getWorkspacesAPI(userId);
20+
const updateWorkspaces = async (userId: number) => {
21+
const { workspaces } = await getWorkspaces(userId);
2222
setWorkspaces(workspaces);
2323
};
2424

2525
useEffect(() => {
26-
getWorkspaces(userId);
26+
updateWorkspaces(userId);
2727
}, []);
2828

2929
return (

0 commit comments

Comments
 (0)