diff --git a/components/common/Card/Card.tsx b/components/common/Card/Card.tsx
index 9aaa2fcde..c8b7c41a5 100644
--- a/components/common/Card/Card.tsx
+++ b/components/common/Card/Card.tsx
@@ -162,14 +162,14 @@ function Card({ item, folderId, folderList }: Props) {
onCloseClick={closeModal}
/>
-
+ /> */}
>
);
}
diff --git a/components/common/LoginCheck/LoginCheck.tsx b/components/common/LoginCheck/LoginCheck.tsx
index 24e3bf7ed..0110718d6 100644
--- a/components/common/LoginCheck/LoginCheck.tsx
+++ b/components/common/LoginCheck/LoginCheck.tsx
@@ -1,19 +1,23 @@
import { useRouter } from "next/router";
import { PropsWithChildren, useEffect } from "react";
-import { TOKEN } from "constants/auth";
+
import { ROUTE_PATHS } from "constants/route";
+import useAuthStore from "store/authStore";
+
const LoginCheck = ({ children }: PropsWithChildren) => {
+ const accessToken = useAuthStore.getState().accessToken;
+
const router = useRouter();
+
useEffect(() => {
- const accessToken = localStorage.getItem(TOKEN.access);
if (accessToken) {
router.push(ROUTE_PATHS.folder);
} else {
return;
}
}, []);
-
+
return
{children}
;
};
diff --git a/constants/endPoint.ts b/constants/endPoint.ts
index 9c3d6cfb0..b0c49b8a6 100644
--- a/constants/endPoint.ts
+++ b/constants/endPoint.ts
@@ -3,7 +3,8 @@ export const API_ENDPOINTS = {
FOLDER_DETAIL: (folderId: number) => `/folders/${folderId}`,
LINKS: "/links",
- LINK_DETAIL: (folderId: number) => `/folders/${folderId}/links`,
+ FOLDER_LINKS_DETAIL: (folderId: number) => `/folders/${folderId}/links`,
+ LINK_DETAIL: (linkId: number) => `/links/${linkId}`,
USERS: "/users",
CHECK_EMAIL: "/users/check-email",
diff --git a/hooks/useDeleteLink.ts b/hooks/useDeleteLink.ts
index 7586fa73c..b7ae4c56c 100644
--- a/hooks/useDeleteLink.ts
+++ b/hooks/useDeleteLink.ts
@@ -4,7 +4,7 @@ import instance from "lib/axios";
import { QUERY_KEYS } from "constants/queryKey";
import { API_ENDPOINTS } from "constants/endPoint";
-export const useDeleteLink = (folderId: number) => {
+export const useDeleteLink = (folderId: number | null) => {
const deleteLink = async (linkId: number) => {
try {
await instance.delete(API_ENDPOINTS.LINK_DETAIL(linkId));
diff --git a/hooks/useGetLinks.ts b/hooks/useGetLinks.ts
index 56ed13d96..b178d0436 100644
--- a/hooks/useGetLinks.ts
+++ b/hooks/useGetLinks.ts
@@ -18,7 +18,7 @@ export const useGetLinks = (folderId: number | null) => {
const fetchLinks = async () => {
try {
const url = folderId
- ? API_ENDPOINTS.LINK_DETAIL(folderId)
+ ? API_ENDPOINTS.FOLDER_LINKS_DETAIL(folderId)
: API_ENDPOINTS.LINKS;
const { data } = await instance.get(url);
return data;