mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
비밀번호 변경 페이지 구현
This commit is contained in:
14
src/routes/(main)/menu/+page.ts
Normal file
14
src/routes/(main)/menu/+page.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { error } from "@sveltejs/kit";
|
||||
import { callGetApi } from "$lib/hooks";
|
||||
import type { UserInfoResponse } from "$lib/server/schemas";
|
||||
import type { PageLoad } from "./$types";
|
||||
|
||||
export const load: PageLoad = async ({ fetch }) => {
|
||||
const res = await callGetApi("/api/user", fetch);
|
||||
if (!res.ok) {
|
||||
error(500, "Internal server error");
|
||||
}
|
||||
|
||||
const { nickname }: UserInfoResponse = await res.json();
|
||||
return { nickname };
|
||||
};
|
||||
Reference in New Issue
Block a user