Skip to content

Commit

Permalink
refactor: props 타입은 원래 코드로 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
chlwlstlf committed Jan 17, 2025
1 parent 3a6fd57 commit c20ac75
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
11 changes: 0 additions & 11 deletions frontend/src/@types/apiClient.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
export type Method = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";

export interface ApiProps {
endpoint: string;
headers?: Record<string, string>;
body?: object | null;
errorMessage?: string;
}

export interface RequestProps extends ApiProps {
method: Method;
}

export interface QueueItem {
resolve: (value: string | PromiseLike<string>) => void;
reject: (reason?: Error) => void;
Expand Down
13 changes: 12 additions & 1 deletion frontend/src/apis/apiClient.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import { API_ENDPOINTS } from "./endpoints";
import { ApiProps, Method, QueueItem, RequestProps } from "@/@types/apiClient";
import { Method, QueueItem } from "@/@types/apiClient";
import { serverUrl } from "@/config/serverUrl";
import MESSAGES from "@/constants/message";
import { AuthorizationError, HTTPError } from "@/utils/Errors";

export interface ApiProps {
endpoint: string;
headers?: Record<string, string>;
body?: object | null;
errorMessage?: string;
}

export interface RequestProps extends ApiProps {
method: Method;
}

let isRefreshing = false;
let failedQueue: QueueItem[] = [];

Expand Down

0 comments on commit c20ac75

Please sign in to comment.