Skip to content

Commit

Permalink
fix: totalElements가 없는 경우 query string에서 제외
Browse files Browse the repository at this point in the history
  • Loading branch information
xodms0309 committed Oct 16, 2023
1 parent f614eda commit 63ae8b3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ interface PageParam {

const fetchRecipeComments = async (pageParam: PageParam, recipeId: number) => {
const { lastId, totalElements } = pageParam;
const queries = `?lastId=${lastId}${totalElements !== null ? `&totalElements=${totalElements}` : ''}`;

const response = await recipeApi.get({
params: `/${recipeId}/comments`,
queries: `?lastId=${lastId}&totalElements=${totalElements}`,
credentials: true,
queries: queries,
});
const data: CommentResponse = await response.json();
return data;
Expand Down

0 comments on commit 63ae8b3

Please sign in to comment.