Skip to content
Snippets Groups Projects
Commit 93c3faf1 authored by syuilo's avatar syuilo
Browse files

[API] Fix bug and change limit 50 to 30

parent 4f5928c5
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,10 @@ module.exports = async (params, user, _, isSecure) =>
// Get 'name' parameter
const name = params.name;
if (name !== undefined && name !== null) {
if (typeof name != 'string') {
return rej('name must be a string');
}
if (!isValidName(name)) {
return rej('invalid name');
}
......
......@@ -16,7 +16,7 @@ export function validatePassword(password: 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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment