Skip to content

Commit fd6eb9a

Browse files
authored
Merge pull request #6 from boostcampwm-2024/refactor-fe-#2
FCP 개선을 위한 사용하지 않는 js 코드 삭제
2 parents a611c67 + bc6a568 commit fd6eb9a

File tree

25 files changed

+24
-176
lines changed

25 files changed

+24
-176
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-
}

apps/frontend/src/entities/user/model/useUserConnection.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// provider: createSocketIOProvider("users", new Y.Doc()),
21
import * as Y from "yjs";
32
import { createSocketIOProvider } from "@/shared/api";
43
import useConnectionStore from "@/shared/model/useConnectionStore";

apps/frontend/src/features/canvas/model/calculateHandles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Position, Node } from "@xyflow/react";
22

3-
export const getHandlePosition = (node: Node, handleId: Position) => {
3+
const getHandlePosition = (node: Node, handleId: Position) => {
44
const nodeElement = document.querySelector(`[data-id="${node.id}"]`);
55
const nodeRect = nodeElement!.getBoundingClientRect();
66
const nodeWidth = nodeRect.width;

apps/frontend/src/features/canvas/model/useCanvas.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ export const useCanvas = () => {
326326
nodes,
327327
edges,
328328
users,
329-
setCurrentPage,
330329
handleMouseMove,
331330
handleNodesChange,
332331
handleEdgesChange,

apps/frontend/src/features/canvas/ui/Canvas/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function Canvas({ className }: CanvasProps) {
6060
}, [users]);
6161

6262
return (
63-
<div className={cn("", className)} onMouseMove={handleMouseMove}>
63+
<div className={cn(className)} onMouseMove={handleMouseMove}>
6464
<ReactFlow
6565
nodes={nodes}
6666
edges={edges}

apps/frontend/src/features/editor/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ export { onUploadImage } from "./api/uploadApi";
22

33
export { useEditorStore } from "./model/editorStore";
44

5-
// TODO: 정리
65
export { Editor } from "@/features/editor/ui/Editor";
76
export { EditorTitle } from "@/features/editor/ui/EditorTitle";
87
export { EditorActionPanel } from "@/features/editor/ui/EditorActionPanel";

apps/frontend/src/features/editor/model/upload.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { createImageUpload } from "novel/plugins";
22

33
import { onUploadImage } from "../api/uploadApi";
44

5-
// TODO: validateFn 수정해야할듯?
65
export const uploadFn = createImageUpload({
76
onUpload: onUploadImage,
87
validateFn: (file) => {

apps/frontend/src/features/editor/ui/Editor/extensions.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ import { UploadImagesPlugin } from "novel/plugins";
2525
import { cx } from "class-variance-authority";
2626
import { common, createLowlight } from "lowlight";
2727

28-
//TODO I am using cx here to get tailwind autocomplete working, idk if someone else can write a regex to just capture the class key in objects
2928
const aiHighlight = AIHighlight;
30-
//You can overwrite the placeholder with your own configuration
3129
const placeholder = Placeholder;
3230
const tiptapLink = TiptapLink.configure({
3331
HTMLAttributes: {
@@ -119,8 +117,6 @@ const starterKit = StarterKit.configure({
119117
});
120118

121119
const codeBlockLowlight = CodeBlockLowlight.configure({
122-
// configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only
123-
// common: covers 37 language grammars which should be good enough in most cases
124120
lowlight: createLowlight(common),
125121
});
126122

0 commit comments

Comments
 (0)