mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-10 07:36:09 +08:00
checking if tag name is valid when editing name. closes #2058
This commit is contained in:
parent
47654d6a9e
commit
6f77cb1b6d
1 changed files with 5 additions and 0 deletions
|
@ -244,6 +244,11 @@ class UserController {
|
|||
try {
|
||||
const { uid } = req.decodedToken;
|
||||
const { tagid, newname } = req.body;
|
||||
if (!isTagPresetNameValid(newname))
|
||||
return res.status(400).json({
|
||||
message:
|
||||
"Tag name invalid. Name cannot contain special characters or more than 16 characters. Can include _ . and -",
|
||||
});
|
||||
await UsersDAO.editTag(uid, tagid, newname);
|
||||
return res.sendStatus(200);
|
||||
} catch (e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue