Skip to content

Commit

Permalink
feat: totalElements가 null일 때 아예 쿼리를 보내지 않도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
xodms0309 committed Oct 16, 2023
1 parent be83c6b commit ae80786
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface PageParam {

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

const response = await recipeApi.get({
params: `/${recipeId}/comments`,
Expand Down

0 comments on commit ae80786

Please sign in to comment.