mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-23 01:13:48 +01:00
[API] Fix bug and change limit 50 to 30
This commit is contained in:
parent
e84c12636b
commit
c429059680
@ -25,6 +25,10 @@ module.exports = async (params, user, _, isSecure) =>
|
|||||||
// Get 'name' parameter
|
// Get 'name' parameter
|
||||||
const name = params.name;
|
const name = params.name;
|
||||||
if (name !== undefined && name !== null) {
|
if (name !== undefined && name !== null) {
|
||||||
|
if (typeof name != 'string') {
|
||||||
|
return rej('name must be a string');
|
||||||
|
}
|
||||||
|
|
||||||
if (!isValidName(name)) {
|
if (!isValidName(name)) {
|
||||||
return rej('invalid name');
|
return rej('invalid name');
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ export function validatePassword(password: string): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isValidName(name: string): boolean {
|
export function isValidName(name: string): boolean {
|
||||||
return typeof name == 'string' && name.length > 50 && name.trim() != '';
|
return typeof name == 'string' && name.length < 30 && name.trim() != '';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isValidBirthday(birthday: string): boolean {
|
export function isValidBirthday(birthday: string): boolean {
|
||||||
|
Loading…
Reference in New Issue
Block a user