Skip to content

Commit

Permalink
Merge branch 'feature/simulation' of https://github.com/letsescape/ba…
Browse files Browse the repository at this point in the history
…npick-fe into feature/simulation
  • Loading branch information
LeeByeongMuk committed May 27, 2024
2 parents ebaea32 + 3056a61 commit 9b82777
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/app/types/champion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ interface ChampionData {
image: string;

// TODO: 모름...
champion_id: number,
img_default: string,
champion_id: number;
img_default: string;
}

interface ChampionsRes {
Expand Down
3 changes: 1 addition & 2 deletions src/app/types/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

declare module NodeJS {
interface ProcessEnv {
APP_API_URL: string;
PUSHER_APP_KEY: string;
}
}
}
5 changes: 2 additions & 3 deletions src/app/types/simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ interface TempChampion {
img_default: string;
}


// API Types

// TODO: Define SimulationLinks
Expand All @@ -37,7 +36,7 @@ interface SimulationLinks {

// TODO: Define SimulationData
type SimulationData = any & {
links:SimulationLinks
links: SimulationLinks;
};

interface SimulationCreateReq {
Expand Down Expand Up @@ -76,5 +75,5 @@ export type {
SimulationRes,
SimulationResultReq,
SimulationResultRes,
SimulationLinks
SimulationLinks,
};
11 changes: 7 additions & 4 deletions src/app/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { TOKEN_KEY } from '@/app/constants/auth';

const fetchApi = async <Response>(
url: string,
options: RequestInit = {},
options: RequestInit = {}
): Promise<Response> => {
const cookieStore = cookies();
const requestUrl = getRequestUrl({
url,
method: options?.method,
query: (options?.body as string),
query: options?.body as string,
});
const hasAccessToken = cookieStore.has(TOKEN_KEY);

Expand Down Expand Up @@ -50,10 +50,13 @@ const updateObjectToQueryString = (obj: string) => {
} catch {
return '';
}

};

const getRequestUrl = ({ url, query, method }: {
const getRequestUrl = ({
url,
query,
method,
}: {
url: string;
query?: string;
method?: string;
Expand Down

0 comments on commit 9b82777

Please sign in to comment.