Skip to content

Commit

Permalink
FIX : API 엔드포인트 변경에 따른 조치 (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
jobkaeHenry authored Nov 29, 2023
1 parent 769547e commit c9bf7f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion client/src/const/serverPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ export const LOGOUT_BFF = "/api/auth/logout-internal" as const;
/**
* 게시물리스트를 받아오거나, 작성하는 Path
*/
export const POST_LIST = "/posts" as const;
export const POST_LIST = "/posts/old" as const;

/**
* 게시물리스트를 받아오거나, 작성하는 Path 버전2 (Breaking Change)
*/
export const POST_LIST_V2 = "/posts" as const;
/**
* ID(pk) 를 입력받아 해당 포스트를 지우는 URL
*/
Expand Down
3 changes: 2 additions & 1 deletion client/src/queries/post/useGetPostListInfiniteQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import axios from "@/libs/axios";
import { PostInterface } from "@/types/post/PostInterface";
import { AxiosRequestConfig } from "axios";
import getTokenFromLocalStorage from "@/utils/getTokenFromLocalStorage";
import { POST_LIST } from "@/const/serverPath";

export interface UseGetPostListQueryInterface extends GetPostListOptions {
initialData?: AugmentedGetPostListResponse;
Expand Down Expand Up @@ -80,7 +81,7 @@ export const getPostListQueryFn = async ({
}: GetPostListOptions & {
headers?: AxiosRequestConfig<any>["headers"];
}): Promise<AugmentedGetPostListResponse> => {
const { data } = await axios.get<GetPostListResponse>("/posts", {
const { data } = await axios.get<GetPostListResponse>(POST_LIST, {
baseURL: process.env.NEXT_PUBLIC_BASE_URL,
params: { page, size, searchKeyword, searchUserNos },
headers,
Expand Down

0 comments on commit c9bf7f9

Please sign in to comment.