Skip to content

Commit 1446281

Browse files
committed
fix: Workspace API 관련 타입 수정
1 parent 5aee6bf commit 1446281

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

apps/frontend/src/features/workspace/model/useWorkspaceStatus.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import {
77
} from "../api/workspaceStatusApi";
88

99
export const useWorkspaceStatus = () => {
10-
const { data: workspaces } = useUserWorkspace();
10+
const { data } = useUserWorkspace();
1111
const currentWorkspaceId = useWorkspace();
1212

13-
return workspaces?.find((workspace) => workspace.id === currentWorkspaceId)
14-
?.visibility;
13+
const workspaces = data?.workspaces;
14+
return workspaces?.find(
15+
(workspace) => workspace.workspaceId === currentWorkspaceId,
16+
)?.visibility;
1517
};
1618

1719
export const useToggleWorkspaceStatus = (

apps/frontend/src/features/workspace/ui/ShareTool/ShareButton.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ import { useUserWorkspace } from "../../model/useWorkspace";
55

66
export function Sharebutton() {
77
const currentWorkspaceId = useWorkspace();
8-
const workspaces = useUserWorkspace();
8+
const { data } = useUserWorkspace();
9+
const workspaces = data?.workspaces;
910
const workspace = workspaces?.find(
10-
(workspace) => workspace.id === currentWorkspaceId,
11+
(workspace) => workspace.workspaceId === currentWorkspaceId,
1112
);
1213
const isGuest = workspace?.role === "guest";
1314

1415
return (
1516
<div className="flex h-9 items-center justify-center">
1617
<button
1718
disabled={isGuest}
18-
className="rounded-md bg-blue-400 px-2 py-1 text-[#171717] hover:bg-blue-500"
19+
className="rounded-md bg-blue-400 px-2 py-1 text-sm text-white hover:bg-blue-500"
1920
>
2021
공유
2122
</button>

0 commit comments

Comments
 (0)