-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
152 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
export type UserInfoResponse = { | ||
username: string, | ||
name: string | ||
} | ||
|
||
export type UserUpdateRequest = { | ||
username?: string, | ||
name?: string, | ||
password?: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { z, ZodType } from "zod"; | ||
|
||
export class UserValidation { | ||
static readonly INFO: ZodType = z.object({ | ||
username: z.string({ | ||
invalid_type_error: "username should be string", | ||
}).min(4, { | ||
message: "username should be more than 4 characters" | ||
}).max(100, { | ||
message: "username should less than 100 characters" | ||
}).optional(), | ||
name: z.string({ | ||
invalid_type_error: "name should be string", | ||
}).min(1, { | ||
message: "name should be more than 1 characters" | ||
}).max(100, { | ||
message: "name should less than 100 characters" | ||
}).optional(), | ||
password: z.string({ | ||
invalid_type_error: "password should be string", | ||
}).min(6, { | ||
message: "password should be more than 6 characters" | ||
}).max(100, { | ||
message: "password should less than 100 characters" | ||
}).optional(), | ||
}) | ||
} |