Skip to content

Commit f3c8381

Browse files
authored
Chore/#329-K: 공통 패키지 폴더 정리 (#330)
* fix: BlockType enum constants 폴더로 이동 * fix: @wabinar/constants package.json 수정 * fix: POST 인터페이스 타입 params → body 수정 * fix: console.log 제거
1 parent 5525c7d commit f3c8381

File tree

17 files changed

+143
-103
lines changed

17 files changed

+143
-103
lines changed

@wabinar/api-types/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export interface PostLoginParams {
1+
export interface PostLoginBody {
22
code: string;
33
}

@wabinar/api-types/workspace.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ export interface Workspace {
44
code: string;
55
}
66

7-
export interface PostParams {
7+
export interface PostBody {
88
name: string;
99
}
1010

11-
export interface PostJoinParams {
11+
export interface PostJoinBody {
1212
code: string;
1313
}
1414

File renamed without changes.

@wabinar/constants/package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{
22
"name": "@wabinar/constants",
33
"version": "1.0.0",
4-
"description": "CRDT for wabinar",
5-
"license": "MIT",
6-
"scripts": {
7-
"test": "jest"
8-
},
9-
"devDependencies": {
10-
"jest": "^29.3.1"
11-
}
4+
"description": "Constants for wabinar",
5+
"license": "MIT"
126
}

client/src/apis/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PostLoginParams } from '@wabinar/api-types/auth';
1+
import { PostLoginBody } from '@wabinar/api-types/auth';
22
import { User } from 'src/types/user';
33
import { Workspace } from 'src/types/workspace';
44

@@ -21,7 +21,7 @@ export const getAuth = async (): Promise<GetUserInfo> => {
2121

2222
export const postAuthLogin = async ({
2323
code,
24-
}: PostLoginParams): Promise<GetUserInfo> => {
24+
}: PostLoginBody): Promise<GetUserInfo> => {
2525
const res = await http.post(`/auth/login`, { code });
2626

2727
if (res.status !== CREATED) throw new Error();

client/src/apis/workspace.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import {
22
GetInfoParams,
3-
PostJoinParams,
4-
PostParams,
3+
PostJoinBody,
4+
PostBody,
55
} from '@wabinar/api-types/workspace';
66
import { Workspace, WorkspaceInfo } from 'src/types/workspace';
77

88
import { http } from './http';
99
import { CREATED, OK } from './http-status';
1010

11-
export const postWorkspace = async ({
12-
name,
13-
}: PostParams): Promise<Workspace> => {
11+
export const postWorkspace = async ({ name }: PostBody): Promise<Workspace> => {
1412
const res = await http.post(`/workspace`, { name });
1513

1614
if (res.status !== CREATED) throw new Error();
@@ -20,7 +18,7 @@ export const postWorkspace = async ({
2018

2119
export const postWorkspaceJoin = async ({
2220
code,
23-
}: PostJoinParams): Promise<Workspace> => {
21+
}: PostJoinBody): Promise<Workspace> => {
2422
const res = await http.post(`/workspace/join`, { code });
2523

2624
if (res.status !== CREATED) throw new Error();

client/src/components/Block/TextBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BlockType } from '@wabinar/api-types/block';
1+
import { BlockType } from '@wabinar/constants/block';
22
import { BLOCK_EVENT } from '@wabinar/constants/socket-message';
33
import {
44
RemoteDeleteOperation,

client/src/components/BlockSelector/BlockItem/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BlockType } from '@wabinar/api-types/block';
1+
import { BlockType } from '@wabinar/constants/block';
22

33
import style from './style.module.scss';
44
interface BlockItemProps {

client/src/components/BlockSelector/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BlockType } from '@wabinar/api-types/block';
1+
import { BlockType } from '@wabinar/constants/block';
22
import { BLOCKS_TYPE } from 'src/constants/block';
33

44
import BlockItem from './BlockItem';

0 commit comments

Comments
 (0)