fix(admin): restore digit match in discordId route validation #96
@@ -1113,7 +1113,7 @@ adminRouter.get(
|
|||||||
// #swagger.tags = ['Admin · Moderation']
|
// #swagger.tags = ['Admin · Moderation']
|
||||||
// #swagger.summary = 'Per-user moderation summary (counts, latest tag, linked account)'
|
// #swagger.summary = 'Per-user moderation summary (counts, latest tag, linked account)'
|
||||||
// #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
|
// #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
|
||||||
param('discordId').matches(/^d{1,32}$/),
|
param('discordId').matches(/^\d{1,32}$/),
|
||||||
validate,
|
validate,
|
||||||
moderation.getUser,
|
moderation.getUser,
|
||||||
)
|
)
|
||||||
@@ -1122,7 +1122,7 @@ adminRouter.get(
|
|||||||
// #swagger.tags = ['Admin · Moderation']
|
// #swagger.tags = ['Admin · Moderation']
|
||||||
// #swagger.summary = 'Full moderation action history for a user'
|
// #swagger.summary = 'Full moderation action history for a user'
|
||||||
// #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
|
// #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
|
||||||
param('discordId').matches(/^d{1,32}$/),
|
param('discordId').matches(/^\d{1,32}$/),
|
||||||
validate,
|
validate,
|
||||||
moderation.getUserActions,
|
moderation.getUserActions,
|
||||||
)
|
)
|
||||||
@@ -1131,7 +1131,7 @@ adminRouter.get(
|
|||||||
// #swagger.tags = ['Admin · Moderation']
|
// #swagger.tags = ['Admin · Moderation']
|
||||||
// #swagger.summary = 'Staff notes for a user (admin_only notes hidden from moderators)'
|
// #swagger.summary = 'Staff notes for a user (admin_only notes hidden from moderators)'
|
||||||
// #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
|
// #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
|
||||||
param('discordId').matches(/^d{1,32}$/),
|
param('discordId').matches(/^\d{1,32}$/),
|
||||||
validate,
|
validate,
|
||||||
moderation.getUserNotes,
|
moderation.getUserNotes,
|
||||||
)
|
)
|
||||||
@@ -1140,7 +1140,7 @@ adminRouter.post(
|
|||||||
// #swagger.tags = ['Admin · Moderation']
|
// #swagger.tags = ['Admin · Moderation']
|
||||||
// #swagger.summary = 'Add a staff note (admin_only visibility requires the admin role)'
|
// #swagger.summary = 'Add a staff note (admin_only visibility requires the admin role)'
|
||||||
// #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
|
// #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
|
||||||
param('discordId').matches(/^d{1,32}$/),
|
param('discordId').matches(/^\d{1,32}$/),
|
||||||
body('body').isString().trim().isLength({ min: 1, max: 4000 }),
|
body('body').isString().trim().isLength({ min: 1, max: 4000 }),
|
||||||
body('visibility').optional().isIn(['staff_only', 'admin_only']),
|
body('visibility').optional().isIn(['staff_only', 'admin_only']),
|
||||||
validate,
|
validate,
|
||||||
@@ -1209,7 +1209,7 @@ adminRouter.get(
|
|||||||
// #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
|
// #swagger.security = [{ "cookieAuth": [] }, { "bearerAuth": [] }]
|
||||||
// #swagger.parameters['discordId'] = { in: 'path', required: true, schema: { type: 'string' }, description: 'Discord snowflake.' }
|
// #swagger.parameters['discordId'] = { in: 'path', required: true, schema: { type: 'string' }, description: 'Discord snowflake.' }
|
||||||
/* #swagger.responses[200] = { description: 'Appeals for the user', content: { "application/json": { schema: { type: "array", items: { $ref: "#/components/schemas/AppealQueueItem" } } } } } */
|
/* #swagger.responses[200] = { description: 'Appeals for the user', content: { "application/json": { schema: { type: "array", items: { $ref: "#/components/schemas/AppealQueueItem" } } } } } */
|
||||||
param('discordId').matches(/^d{1,32}$/),
|
param('discordId').matches(/^\d{1,32}$/),
|
||||||
validate,
|
validate,
|
||||||
moderation.getUserAppeals,
|
moderation.getUserAppeals,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user