Skip to content

Commit

Permalink
[Hotfix/FE] 프로필 페이지에서 데스크 셋업 변경 시 refetch가 되지 않는 오류 해결 (#848)
Browse files Browse the repository at this point in the history
fix: 프로필 페이지에서 데스크 셋업 변경 시 refetch가 되지 않는 오류 해결
  • Loading branch information
uk960214 authored Oct 21, 2022
1 parent a8bfa62 commit 4b136f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/hooks/api/useCache.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ function useCache() {
const searchParams = new URLSearchParams(config.params as Record<string, string>);
const page = Number(searchParams.get('page'));
searchParams.delete('page');
const cacheKey = `${url}?${searchParams.toString()}`;

const hasNoSearchParams = Array.from(searchParams).length === 0;
const cacheKey = `${url}${hasNoSearchParams ? '' : `?${searchParams.toString()}`}`;
const cachedResponse = getCachedResponse(cacheKey, page);
if (cachedResponse) {
return cachedResponse;
Expand Down

0 comments on commit 4b136f8

Please sign in to comment.