SSR을 비활성화하여 SPA로 전환

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
staticandClaude Opus 5.5 committed 2026-10-11 20:49:24 +09:00
1 parent b35585c7bb
commit 35f3e92b5a
34 files changed
+152 -139

No files matched your search

@@ -1,7 +0,0 @@
import { createCaller } from "$trpc/router.server";
import type { PageServerLoad } from "./$types";
export const load: PageServerLoad = async (event) => {
const favorites = await createCaller(event).favorites.get();
return { favorites };
};
+8
View File
@@ -0,0 +1,8 @@
import { trpc } from "$trpc/client";
import type { PageLoad } from "./$types";
export const load: PageLoad = async ({ parent }) => {
await parent(); // Wait for the key guard in the root layout
const favorites = await trpc.favorites.get.query();
return { favorites };
};
+2 -2
View File
@@ -52,9 +52,9 @@ export const requestFavoriteEntries = async (
export const requestRemoveFavorite = async (type: "file" | "directory", id: number) => {
try {
if (type === "directory") {
await trpc().favorites.removeDirectory.mutate({ id });
await trpc.favorites.removeDirectory.mutate({ id });
} else {
await trpc().favorites.removeFile.mutate({ id });
await trpc.favorites.removeFile.mutate({ id });
}
return true;
} catch {