RequestHandler 타입을 잘못된 모듈에서 import하던 버그 수정

This commit is contained in:
static
2025-01-08 22:46:34 +09:00
parent 1699d985ac
commit 6559381ed4
2 changed files with 8 additions and 4 deletions

View File

@@ -1,11 +1,15 @@
import { json } from "@sveltejs/kit";
import { error, json } from "@sveltejs/kit";
import { authenticate } from "$lib/server/modules/auth";
import { clientListResponse, type ClientListResponse } from "$lib/server/schemas";
import { getUserClientList } from "$lib/server/services/client";
import type { RequestHandler } from "@sveltejs/kit";
import type { RequestHandler } from "./$types";
export const GET: RequestHandler = async ({ cookies }) => {
const { userId } = authenticate(cookies);
const { userId, clientId } = authenticate(cookies);
if (!clientId) {
error(403, "Forbidden");
}
const { userClients } = await getUserClientList(userId);
return json(clientListResponse.parse({ clients: userClients } satisfies ClientListResponse));
};

View File

@@ -2,7 +2,7 @@ import { error, json } from "@sveltejs/kit";
import { authenticate } from "$lib/server/modules/auth";
import { clientStatusResponse, type ClientStatusResponse } from "$lib/server/schemas";
import { getUserClientStatus } from "$lib/server/services/client";
import type { RequestHandler } from "@sveltejs/kit";
import type { RequestHandler } from "./$types";
export const GET: RequestHandler = async ({ cookies }) => {
const { userId, clientId } = authenticate(cookies);