trying to fix validator default not working
This commit is contained in:
+14
-1
@@ -58,6 +58,20 @@ router.post('/:serverId/kill', (req, res, next) => {
|
|||||||
router.post(
|
router.post(
|
||||||
'/:serverId/kill',
|
'/:serverId/kill',
|
||||||
param('serverId').exists().toInt().isInt(),
|
param('serverId').exists().toInt().isInt(),
|
||||||
|
body([
|
||||||
|
'attacker_current_weapon_mods',
|
||||||
|
'attacker_weapon_1_mods',
|
||||||
|
'attacker_weapon_2_mods',
|
||||||
|
'attacker_weapon_3_mods',
|
||||||
|
'attacker_offhand_weapon_1',
|
||||||
|
'attacker_offhand_weapon_2',
|
||||||
|
'victim_current_weapon_mods',
|
||||||
|
'victim_weapon_1_mods',
|
||||||
|
'victim_weapon_2_mods',
|
||||||
|
'victim_weapon_3_mods',
|
||||||
|
'victim_offhand_weapon_1',
|
||||||
|
'victim_offhand_weapon_2'
|
||||||
|
]).default(0),
|
||||||
body([
|
body([
|
||||||
'attacker_current_weapon_mods',
|
'attacker_current_weapon_mods',
|
||||||
'attacker_weapon_1_mods',
|
'attacker_weapon_1_mods',
|
||||||
@@ -72,7 +86,6 @@ router.post(
|
|||||||
'victim_offhand_weapon_1',
|
'victim_offhand_weapon_1',
|
||||||
'victim_offhand_weapon_2'
|
'victim_offhand_weapon_2'
|
||||||
])
|
])
|
||||||
.customSanitizer((value) => value || 0)
|
|
||||||
.toInt()
|
.toInt()
|
||||||
.isInt()
|
.isInt()
|
||||||
.withMessage('must be a valid int'),
|
.withMessage('must be a valid int'),
|
||||||
|
|||||||
Reference in New Issue
Block a user