mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-14 22:08:45 +00:00
사소한 리팩토링
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
let { children, checked = $bindable(false) }: Props = $props();
|
let { children, checked = $bindable(false) }: Props = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<label class="flex items-center justify-center gap-x-1">
|
<label class="flex items-center gap-x-1">
|
||||||
<input bind:checked type="checkbox" class="hidden" />
|
<input bind:checked type="checkbox" class="hidden" />
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
{#if checked}
|
{#if checked}
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ import {
|
|||||||
} from "$lib/indexedDB";
|
} from "$lib/indexedDB";
|
||||||
import { unwrapDataKey, decryptString } from "$lib/modules/crypto";
|
import { unwrapDataKey, decryptString } from "$lib/modules/crypto";
|
||||||
import type {
|
import type {
|
||||||
CategoryFileListResponse,
|
|
||||||
CategoryInfoResponse,
|
CategoryInfoResponse,
|
||||||
|
CategoryFileListResponse,
|
||||||
DirectoryInfoResponse,
|
DirectoryInfoResponse,
|
||||||
FileInfoResponse,
|
FileInfoResponse,
|
||||||
} from "$lib/server/schemas";
|
} from "$lib/server/schemas";
|
||||||
|
|||||||
@@ -35,8 +35,6 @@
|
|||||||
subCategories = info.subCategoryIds.map((id) =>
|
subCategories = info.subCategoryIds.map((id) =>
|
||||||
getCategoryInfo(id, $masterKeyStore?.get(1)?.key!),
|
getCategoryInfo(id, $masterKeyStore?.get(1)?.key!),
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: Sorting
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -76,8 +76,6 @@
|
|||||||
$effect(() => {
|
$effect(() => {
|
||||||
categories =
|
categories =
|
||||||
$info?.categoryIds.map((id) => getCategoryInfo(id, $masterKeyStore?.get(1)?.key!)) ?? [];
|
$info?.categoryIds.map((id) => getCategoryInfo(id, $masterKeyStore?.get(1)?.key!)) ?? [];
|
||||||
|
|
||||||
// TODO: Sorting
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
|
|||||||
@@ -40,14 +40,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<Button
|
<Button color="gray" onclick={closeModal}>아니요</Button>
|
||||||
color="gray"
|
|
||||||
onclick={() => {
|
|
||||||
isOpen = false;
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
아니요
|
|
||||||
</Button>
|
|
||||||
<Button onclick={deleteEntry}>삭제할게요</Button>
|
<Button onclick={deleteEntry}>삭제할게요</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -48,14 +48,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<Button
|
<Button color="gray" onclick={closeModal}>아니요</Button>
|
||||||
color="gray"
|
|
||||||
onclick={() => {
|
|
||||||
isOpen = false;
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
아니요
|
|
||||||
</Button>
|
|
||||||
<Button onclick={deleteEntry}>삭제할게요</Button>
|
<Button onclick={deleteEntry}>삭제할게요</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,7 +8,11 @@ import type { RequestHandler } from "./$types";
|
|||||||
export const GET: RequestHandler = async ({ locals, url, params }) => {
|
export const GET: RequestHandler = async ({ locals, url, params }) => {
|
||||||
const { userId } = await authorize(locals, "activeClient");
|
const { userId } = await authorize(locals, "activeClient");
|
||||||
|
|
||||||
const paramsZodRes = z.object({ id: z.coerce.number().int().positive() }).safeParse(params);
|
const paramsZodRes = z
|
||||||
|
.object({
|
||||||
|
id: z.coerce.number().int().positive(),
|
||||||
|
})
|
||||||
|
.safeParse(params);
|
||||||
if (!paramsZodRes.success) error(400, "Invalid path parameters");
|
if (!paramsZodRes.success) error(400, "Invalid path parameters");
|
||||||
const { id } = paramsZodRes.data;
|
const { id } = paramsZodRes.data;
|
||||||
|
|
||||||
@@ -27,6 +31,6 @@ export const GET: RequestHandler = async ({ locals, url, params }) => {
|
|||||||
return json(
|
return json(
|
||||||
categoryFileListResponse.parse({
|
categoryFileListResponse.parse({
|
||||||
files: files.map(({ id, isRecursive }) => ({ file: id, isRecursive })),
|
files: files.map(({ id, isRecursive }) => ({ file: id, isRecursive })),
|
||||||
}) as CategoryFileListResponse,
|
}) satisfies CategoryFileListResponse,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user