mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
SSR을 비활성화하여 SPA로 전환
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
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 };
|
||||
};
|
||||
@@ -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 };
|
||||
};
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user