Skip to content

Commit

Permalink
hotfix: 잘못된 queryParam 수정 (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
moonheekim0118 authored Aug 5, 2022
1 parent 514178e commit e04b240
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/api/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface ReturnFunctionParam {
}

export const getMessages =
({ date, channelId }: HighOrderParam = { date: "", channelId: "" }) =>
({ date = "", channelId = "" }: HighOrderParam) =>
async ({ pageParam }: ReturnFunctionParam) => {
if (!pageParam) {
const { data } = await fetcher.get<ResponseMessages>(
Expand All @@ -41,7 +41,9 @@ export const getMessages =
} = pageParam;

const { data } = await fetcher.get<ResponseMessages>(
`${API_ENDPOINT.MESSAGES}?channelIds=${channelId}&messageId=${messageId}&needPastMessage=${needPastMessage}&date=${currentDate}`,
`${API_ENDPOINT.MESSAGES}?channelIds=${
!channelId || channelId === "main" ? "" : channelId
}&messageId=${messageId}&needPastMessage=${needPastMessage}&date=${currentDate}`,
{
headers: { ...getPrivateHeaders() },
}
Expand Down

0 comments on commit e04b240

Please sign in to comment.