mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
create a substring if exceed maximung lenght
This commit is contained in:
parent
de78da3f47
commit
79feaa0608
@ -386,7 +386,8 @@ export default class UserController extends Controller {
|
||||
// check maximung strings length
|
||||
if (typeof req.selection.update[key] === "string" && MaxStringsLengths[key]) {
|
||||
if (req.selection.update[key].length > MaxStringsLengths[key]) {
|
||||
return res.status(400).json({ error: `${key} is too long` })
|
||||
// create a substring
|
||||
req.selection.update[key] = req.selection.update[key].substring(0, MaxStringsLengths[key])
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user