Przeglądaj źródła

unlink specific path

kaori 3 lat temu
rodzic
commit
d89e0929d6
1 zmienionych plików z 2 dodań i 3 usunięć
  1. 2 3
      packages/app/src/stores/page-redirect.tsx

+ 2 - 3
packages/app/src/stores/page-redirect.tsx

@@ -14,14 +14,13 @@ export const useRedirectFrom = (initialData?: string): SWRResponseWithUtils<Redi
   const swrResponse: SWRResponse<string, Error> = useStaticSWR('redirectFrom', initialData);
   const utils = {
     unlink: async(path?: string) => {
-      console.log({ path, currentPagePath });
       if (currentPagePath == null) {
         return;
       }
 
-      const pathHoge = currentPagePath === '/trash' ? `/trash/${path}` : currentPagePath;
+      const pathToUnlink = currentPagePath === '/trash' ? `/trash${path}` : currentPagePath;
       try {
-        await apiPost('/pages.unlink', { path: pathHoge });
+        await apiPost('/pages.unlink', { path: pathToUnlink });
         swrResponse.mutate('');
       }
       catch (err) {