Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX : API 엔드포인트 변경에 따른 조치 #62

Merged
merged 1 commit into from
Nov 29, 2023
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
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
*/
jobkaeHenry marked this conversation as resolved.
Show resolved Hide resolved
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,
jobkaeHenry marked this conversation as resolved.
Show resolved Hide resolved
Expand Down