/api/auth/changePassword, /api/user, /api/user/changeNickname Endpoint 구현

This commit is contained in:
static
2025-01-13 01:57:07 +09:00
parent bd1e9cf54f
commit 299787537e
11 changed files with 125 additions and 2 deletions

View File

@@ -1,5 +1,11 @@
import { z } from "zod";
export const changePasswordRequest = z.object({
oldPassword: z.string().trim().nonempty(),
newPassword: z.string().trim().nonempty(),
});
export type ChangePasswordRequest = z.infer<typeof changePasswordRequest>;
export const loginRequest = z.object({
email: z.string().email().nonempty(),
password: z.string().trim().nonempty(),

View File

@@ -4,3 +4,4 @@ export * from "./directory";
export * from "./file";
export * from "./hsk";
export * from "./mek";
export * from "./user";

View File

@@ -0,0 +1,12 @@
import { z } from "zod";
export const userInfoResponse = z.object({
email: z.string().email().nonempty(),
nickname: z.string().nonempty(),
});
export type UserInfoResponse = z.infer<typeof userInfoResponse>;
export const changeNicknameRequest = z.object({
newNickname: z.string().min(2).max(8),
});
export type ChangeNicknameRequest = z.infer<typeof changeNicknameRequest>;