mirror of
https://github.com/logto-io/logto.git
synced 2025-01-20 21:32:31 -05:00
refactor(core): replace deprecated .nonempty() with .min(1) for ZodString (#1727)
This commit is contained in:
parent
f257e4deb2
commit
3b7f86e2a2
2 changed files with 3 additions and 3 deletions
|
@ -41,8 +41,8 @@ export default function sessionRoutes<T extends AnonymousRouter>(router: T, prov
|
|||
'/session/sign-in/username-password',
|
||||
koaGuard({
|
||||
body: object({
|
||||
username: string().nonempty(),
|
||||
password: string().nonempty(),
|
||||
username: string().min(1),
|
||||
password: string().min(1),
|
||||
}),
|
||||
}),
|
||||
async (ctx, next) => {
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('zodTypeToSwagger', () => {
|
|||
const notStartingWithDigitRegex = /^\D/;
|
||||
|
||||
it('nonempty check', () => {
|
||||
expect(zodTypeToSwagger(string().nonempty())).toEqual({
|
||||
expect(zodTypeToSwagger(string().min(1))).toEqual({
|
||||
type: 'string',
|
||||
minLength: 1,
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue