Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,43 @@ const preview: Preview = {
date: /Date$/i,
},
},
viewport: {
viewports: {
laptop1024: {
name: 'Laptop 1024',
styles: {
width: '1024px',
height: '768px',
},
type: 'desktop',
},
desktop1440: {
name: 'Desktop 1440',
styles: {
width: '1440px',
height: '900px',
},
type: 'desktop',
},
laptopMac13: {
name: 'MacBook 13-inch',
styles: {
width: '1280px',
height: '800px',
},
type: 'desktop',
},
laptopMac16: {
name: 'MacBook Pro 16-inch',
styles: {
width: '1536px',
height: '960px',
},
type: 'desktop',
},
},
defaultViewport: 'responsive',
},
},
loaders: [mswLoader],
decorators: [
Expand Down
9 changes: 6 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="Debate Timer - 효율적인 토론 시간 관리 도구입니다."
content="Debate Timer - 효율적인 토론용 타이머입니다."
/>
<meta
name="keywords"
content="debate, timer, debate timer, 토론, 토론 관리, 토론 시간, 토론 타이머, 토론용 타이머"
/>
<meta name="keywords" content="debate, timer, 토론, 토론 관리, 토론 시간" />
<meta property="og:title" content="Debate Timer" />
<meta property="og:type" content="website" />
<meta
property="og:description"
content="효율적인 토론 시간 관리 도구입니다."
content="Debate Timer - 효율적인 토론용 타이머입니다."
/>
<meta property="og:image" content="/debate_logo.jpg" />
<title>Debate Timer</title>
Expand Down
57 changes: 28 additions & 29 deletions src/apis/apis/customize.ts → src/apis/apis/debateTable.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { CustomizeDebateInfo, CustomizeTimeBoxInfo } from '../../type/type';
import { DebateTableData } from '../../type/type';
import { ApiUrl } from '../endpoints';
import { request } from '../primitives';
import { PutDebateTableRequestType } from '../requests/debateTable';
import {
GetCustomizeTableResponseType,
PatchCustomizeTableResponseType,
PostCustomizeTableResponseType,
PutCustomizeTableResponseType,
} from '../responses/customize';
GetDebateTableResponseType,
PatchDebateTableResponseType,
PostDebateTableResponseType,
PutDebateTableResponseType,
} from '../responses/debateTable';

// Template
/*
Expand All @@ -26,11 +27,11 @@ export async function apiFunc(
*/

// GET /api/table/customize/{tableId}
export async function getCustomizeTableData(
export async function getDebateTableData(
tableId: number,
): Promise<GetCustomizeTableResponseType> {
): Promise<GetDebateTableResponseType> {
const requestUrl: string = ApiUrl.customize;
const response = await request<GetCustomizeTableResponseType>(
const response = await request<GetDebateTableResponseType>(
'GET',
requestUrl + `/${tableId}`,
null,
Expand All @@ -41,12 +42,12 @@ export async function getCustomizeTableData(
}

// POST /api/table/customize
export async function postCustomizeTableData(
info: CustomizeDebateInfo,
tables: CustomizeTimeBoxInfo[],
): Promise<PostCustomizeTableResponseType> {
export async function postDebateTableData({
info,
table,
}: DebateTableData): Promise<PostDebateTableResponseType> {
const requestUrl: string = ApiUrl.customize;
const response = await request<PostCustomizeTableResponseType>(
const response = await request<PostDebateTableResponseType>(
'POST',
requestUrl,
{
Expand All @@ -58,23 +59,23 @@ export async function postCustomizeTableData(
warningBell: info.warningBell,
finishBell: info.finishBell,
},
table: tables,
table,
},
null,
);
return response.data;
}

// PUT /api/table/customize/{tableId}
export async function putCustomizeTableData(
tableId: number,
info: CustomizeDebateInfo,
tables: CustomizeTimeBoxInfo[],
): Promise<PutCustomizeTableResponseType> {
export async function putDebateTableData({
id,
info,
table,
}: PutDebateTableRequestType): Promise<PutDebateTableResponseType> {
const requestUrl: string = ApiUrl.customize;
const response = await request<PutCustomizeTableResponseType>(
const response = await request<PutDebateTableResponseType>(
'PUT',
requestUrl + `/${tableId}`,
requestUrl + `/${id}`,
{
info: {
name: info.name,
Expand All @@ -84,7 +85,7 @@ export async function putCustomizeTableData(
warningBell: info.warningBell,
finishBell: info.finishBell,
},
table: tables,
table,
},
null,
);
Expand All @@ -93,9 +94,7 @@ export async function putCustomizeTableData(
}

// DELETE /api/table/customize/{tableId}
export async function deleteCustomizeTableData(
tableId: number,
): Promise<boolean> {
export async function deleteDebateTableData(tableId: number): Promise<boolean> {
const requestUrl: string = ApiUrl.customize;
const response = await request(
'DELETE',
Expand All @@ -108,11 +107,11 @@ export async function deleteCustomizeTableData(
}

// PATCH /api/table/customize/{tableId}/debate
export async function patchCustomizeTableData(
export async function patchDebateTableData(
tableId: number,
): Promise<PatchCustomizeTableResponseType> {
): Promise<PatchDebateTableResponseType> {
const requestUrl: string = ApiUrl.customize;
const response = await request<PatchCustomizeTableResponseType>(
const response = await request<PatchDebateTableResponseType>(
'PATCH',
requestUrl + `/${tableId}/debate`,
null,
Expand Down
123 changes: 0 additions & 123 deletions src/apis/apis/parliamentary.ts

This file was deleted.

5 changes: 5 additions & 0 deletions src/apis/requests/debateTable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { DebateTableData } from '../../type/type';

export interface PutDebateTableRequestType extends DebateTableData {
id: number;
}
29 changes: 0 additions & 29 deletions src/apis/responses/customize.ts

This file was deleted.

27 changes: 27 additions & 0 deletions src/apis/responses/debateTable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { DebateTableData } from '../../type/type';

// POST /api/table/customize
export interface PostDebateTableResponseType extends DebateTableData {
id: number;
}

// PUT /api/table/customize/{tableId}
export interface PutDebateTableResponseType extends DebateTableData {
id: number;
}

// GET /api/table/customize/{tableId}
export interface GetDebateTableResponseType extends DebateTableData {
id: number;
}

// GET /api/table/customize/{tableId}
export interface GetDebateTableResponseType extends DebateTableData {
id: number;
}

// PATCH /api/table/customize/{tableId}

export interface PatchDebateTableResponseType extends DebateTableData {
id: number;
}
Loading