mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-11 01:44:50 +08:00
more validation
This commit is contained in:
parent
385fc00ea2
commit
698d43d64e
1 changed files with 12 additions and 3 deletions
|
|
@ -258,7 +258,10 @@ router.patch(
|
|||
RateLimit.userTagsEdit,
|
||||
validateRequest({
|
||||
body: {
|
||||
tagId: joi.string().required(),
|
||||
tagId: joi
|
||||
.string()
|
||||
.regex(/^[a-f\d]{24}$/i)
|
||||
.required(),
|
||||
newName: tagNameValidation,
|
||||
},
|
||||
}),
|
||||
|
|
@ -271,7 +274,10 @@ router.delete(
|
|||
RateLimit.userTagsRemove,
|
||||
validateRequest({
|
||||
params: {
|
||||
tagId: joi.string().required(),
|
||||
tagId: joi
|
||||
.string()
|
||||
.regex(/^[a-f\d]{24}$/i)
|
||||
.required(),
|
||||
},
|
||||
}),
|
||||
asyncHandler(UserController.removeTag)
|
||||
|
|
@ -283,7 +289,10 @@ router.delete(
|
|||
RateLimit.userTagsClearPB,
|
||||
validateRequest({
|
||||
params: {
|
||||
tagId: joi.string().required(),
|
||||
tagId: joi
|
||||
.string()
|
||||
.regex(/^[a-f\d]{24}$/i)
|
||||
.required(),
|
||||
},
|
||||
}),
|
||||
asyncHandler(UserController.clearTagPb)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue