Skip to content

Commit 860d156

Browse files
committed
refactor: page 관련 미사용 API 제거거
1 parent d5e2e07 commit 860d156

File tree

3 files changed

+3
-53
lines changed

3 files changed

+3
-53
lines changed
Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
1-
import { Get, Post, Delete, Patch } from "@/shared/api";
2-
import {
3-
GetPageResponse,
4-
GetPagesResponse,
5-
CreatePageRequest,
6-
CreatePageResponse,
7-
UpdatePageRequest,
8-
} from "../model/pageTypes";
9-
10-
export const getPage = async (id: number) => {
11-
const url = `/api/page/${id}`;
12-
13-
const res = await Get<GetPageResponse>(url);
14-
return res.data.page;
15-
};
16-
17-
// TODO: 임시
18-
export const getPages = async (workspaceId: string) => {
19-
const url = `/api/page/workspace/${workspaceId}`;
20-
21-
const res = await Get<GetPagesResponse>(url);
22-
return res.data.pages;
23-
};
1+
import { Post, Delete } from "@/shared/api";
2+
import { CreatePageRequest, CreatePageResponse } from "../model/pageTypes";
243

254
export const createPage = async (pageData: CreatePageRequest) => {
265
const url = `/api/page`;
@@ -35,10 +14,3 @@ export const deletePage = async (id: number) => {
3514
const res = await Delete<null>(url);
3615
return res.data;
3716
};
38-
39-
export const updatePage = async (id: number, pageData: UpdatePageRequest) => {
40-
const url = `/api/page/${id}`;
41-
42-
const res = await Patch<null, UpdatePageRequest>(url, pageData);
43-
return res.data;
44-
};

apps/frontend/src/entities/page/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
export {
2-
getPage,
3-
getPages,
4-
createPage,
5-
deletePage,
6-
updatePage,
7-
} from "./api/pageApi";
1+
export { createPage, deletePage } from "./api/pageApi";
82
export { useCreatePage, useDeletePage } from "./model/pageMutations";
93

104
export { usePageStore } from "./model/pageStore";

apps/frontend/src/entities/page/model/pageTypes.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@ export interface Page {
77
emoji: string | null;
88
}
99

10-
export interface GetPageResponse {
11-
message: string;
12-
page: Page;
13-
}
14-
15-
export interface GetPagesResponse {
16-
message: string;
17-
pages: Omit<Page, "content">[];
18-
}
19-
2010
export interface CreatePageRequest {
2111
title: string;
2212
content: JSONContent;
@@ -30,9 +20,3 @@ export interface CreatePageResponse {
3020
message: string;
3121
pageId: number;
3222
}
33-
34-
export interface UpdatePageRequest {
35-
title: string;
36-
content: JSONContent;
37-
emoji: string | null;
38-
}

0 commit comments

Comments
 (0)