사소한 리팩토링

This commit is contained in:
static
2025-01-23 13:21:34 +09:00
parent ca67f5a81c
commit fd10f13a4d
7 changed files with 10 additions and 24 deletions

View File

@@ -76,8 +76,6 @@
$effect(() => {
categories =
$info?.categoryIds.map((id) => getCategoryInfo(id, $masterKeyStore?.get(1)?.key!)) ?? [];
// TODO: Sorting
});
$effect(() => {

View File

@@ -40,14 +40,7 @@
</p>
</div>
<div class="flex gap-2">
<Button
color="gray"
onclick={() => {
isOpen = false;
}}
>
아니요
</Button>
<Button color="gray" onclick={closeModal}>아니요</Button>
<Button onclick={deleteEntry}>삭제할게요</Button>
</div>
</div>

View File

@@ -48,14 +48,7 @@
</p>
</div>
<div class="flex gap-2">
<Button
color="gray"
onclick={() => {
isOpen = false;
}}
>
아니요
</Button>
<Button color="gray" onclick={closeModal}>아니요</Button>
<Button onclick={deleteEntry}>삭제할게요</Button>
</div>
</div>

View File

@@ -8,7 +8,11 @@ import type { RequestHandler } from "./$types";
export const GET: RequestHandler = async ({ locals, url, params }) => {
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");
const { id } = paramsZodRes.data;
@@ -27,6 +31,6 @@ export const GET: RequestHandler = async ({ locals, url, params }) => {
return json(
categoryFileListResponse.parse({
files: files.map(({ id, isRecursive }) => ({ file: id, isRecursive })),
}) as CategoryFileListResponse,
}) satisfies CategoryFileListResponse,
);
};