Skip to content

Commit

Permalink
fix: 시크릿 탭에서 공유 링크 카운트 업데이트 중복 요청하는 문제
Browse files Browse the repository at this point in the history
  • Loading branch information
nim-od committed Aug 22, 2024
1 parent 414d10d commit 0ce6c21
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
15 changes: 0 additions & 15 deletions packages/user/src/hooks/query/useUpdateShareLinkClickCount.ts

This file was deleted.

9 changes: 6 additions & 3 deletions packages/user/src/routes/loader/share-redirect.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { LoaderFunction, redirect } from 'react-router-dom';
import RoutePaths from 'src/constants/routePath.ts';
import { clickCountQueryOptions } from 'src/hooks/query/useUpdateShareLinkClickCount.ts';
import { queryClient } from 'src/libs/query/index.tsx';
import http from 'src/services/api/index.ts';

const shareRedirectLoader: LoaderFunction = async ({ params }) => {
const { id } = params;

await queryClient.fetchQuery(clickCountQueryOptions(id));
try {
await http.get(`/share-link/${id}`);
} catch (error) {
return redirect(RoutePaths.Home);
}

return redirect(RoutePaths.Home);
};
Expand Down
1 change: 0 additions & 1 deletion packages/user/src/services/api/queryKey.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const QUERY_KEYS = {
EVENT_DURATION: 'event-duration',
GET_LINK_SHARE_COUNT: 'get-link-share-count',
UPDATE_SHARE_COUNT: 'update-link-share-count',
TEAM_TYPE_QUIZ: 'team-type-quiz',
FCFS_QUIZ: 'fcfs-quiz',
USER_INFO: 'user-info',
Expand Down

0 comments on commit 0ce6c21

Please sign in to comment.