diff options
Diffstat (limited to 'server/middlewares/validators/abuse.ts')
-rw-r--r-- | server/middlewares/validators/abuse.ts | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/server/middlewares/validators/abuse.ts b/server/middlewares/validators/abuse.ts index e4aa1a839..9b94008ce 100644 --- a/server/middlewares/validators/abuse.ts +++ b/server/middlewares/validators/abuse.ts | |||
@@ -52,8 +52,6 @@ const abuseReportValidator = [ | |||
52 | .custom(areAbusePredefinedReasonsValid), | 52 | .custom(areAbusePredefinedReasonsValid), |
53 | 53 | ||
54 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 54 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
55 | logger.debug('Checking abuseReport parameters', { parameters: req.body }) | ||
56 | |||
57 | if (areValidationErrors(req, res)) return | 55 | if (areValidationErrors(req, res)) return |
58 | 56 | ||
59 | const body: AbuseCreate = req.body | 57 | const body: AbuseCreate = req.body |
@@ -76,8 +74,6 @@ const abuseGetValidator = [ | |||
76 | .custom(isIdValid), | 74 | .custom(isIdValid), |
77 | 75 | ||
78 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 76 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
79 | logger.debug('Checking abuseGetValidator parameters', { parameters: req.body }) | ||
80 | |||
81 | if (areValidationErrors(req, res)) return | 77 | if (areValidationErrors(req, res)) return |
82 | if (!await doesAbuseExist(req.params.id, res)) return | 78 | if (!await doesAbuseExist(req.params.id, res)) return |
83 | 79 | ||
@@ -97,8 +93,6 @@ const abuseUpdateValidator = [ | |||
97 | .custom(isAbuseModerationCommentValid), | 93 | .custom(isAbuseModerationCommentValid), |
98 | 94 | ||
99 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 95 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
100 | logger.debug('Checking abuseUpdateValidator parameters', { parameters: req.body }) | ||
101 | |||
102 | if (areValidationErrors(req, res)) return | 96 | if (areValidationErrors(req, res)) return |
103 | if (!await doesAbuseExist(req.params.id, res)) return | 97 | if (!await doesAbuseExist(req.params.id, res)) return |
104 | 98 | ||
@@ -139,8 +133,6 @@ const abuseListForAdminsValidator = [ | |||
139 | .custom(exists), | 133 | .custom(exists), |
140 | 134 | ||
141 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 135 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
142 | logger.debug('Checking abuseListForAdminsValidator parameters', { parameters: req.body }) | ||
143 | |||
144 | if (areValidationErrors(req, res)) return | 136 | if (areValidationErrors(req, res)) return |
145 | 137 | ||
146 | return next() | 138 | return next() |
@@ -161,8 +153,6 @@ const abuseListForUserValidator = [ | |||
161 | .custom(isAbuseStateValid), | 153 | .custom(isAbuseStateValid), |
162 | 154 | ||
163 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 155 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
164 | logger.debug('Checking abuseListForUserValidator parameters', { parameters: req.body }) | ||
165 | |||
166 | if (areValidationErrors(req, res)) return | 156 | if (areValidationErrors(req, res)) return |
167 | 157 | ||
168 | return next() | 158 | return next() |
@@ -174,8 +164,6 @@ const getAbuseValidator = [ | |||
174 | .custom(isIdValid), | 164 | .custom(isIdValid), |
175 | 165 | ||
176 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 166 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
177 | logger.debug('Checking getAbuseValidator parameters', { parameters: req.body }) | ||
178 | |||
179 | if (areValidationErrors(req, res)) return | 167 | if (areValidationErrors(req, res)) return |
180 | if (!await doesAbuseExist(req.params.id, res)) return | 168 | if (!await doesAbuseExist(req.params.id, res)) return |
181 | 169 | ||
@@ -198,8 +186,6 @@ const getAbuseValidator = [ | |||
198 | 186 | ||
199 | const checkAbuseValidForMessagesValidator = [ | 187 | const checkAbuseValidForMessagesValidator = [ |
200 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 188 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
201 | logger.debug('Checking checkAbuseValidForMessagesValidator parameters', { parameters: req.body }) | ||
202 | |||
203 | const abuse = res.locals.abuse | 189 | const abuse = res.locals.abuse |
204 | if (abuse.ReporterAccount.isOwned() === false) { | 190 | if (abuse.ReporterAccount.isOwned() === false) { |
205 | return res.fail({ message: 'This abuse was created by a user of your instance.' }) | 191 | return res.fail({ message: 'This abuse was created by a user of your instance.' }) |
@@ -214,8 +200,6 @@ const addAbuseMessageValidator = [ | |||
214 | .custom(isAbuseMessageValid), | 200 | .custom(isAbuseMessageValid), |
215 | 201 | ||
216 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 202 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
217 | logger.debug('Checking addAbuseMessageValidator parameters', { parameters: req.body }) | ||
218 | |||
219 | if (areValidationErrors(req, res)) return | 203 | if (areValidationErrors(req, res)) return |
220 | 204 | ||
221 | return next() | 205 | return next() |
@@ -227,8 +211,6 @@ const deleteAbuseMessageValidator = [ | |||
227 | .custom(isIdValid), | 211 | .custom(isIdValid), |
228 | 212 | ||
229 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 213 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
230 | logger.debug('Checking deleteAbuseMessageValidator parameters', { parameters: req.body }) | ||
231 | |||
232 | if (areValidationErrors(req, res)) return | 214 | if (areValidationErrors(req, res)) return |
233 | 215 | ||
234 | const user = res.locals.oauth.token.user | 216 | const user = res.locals.oauth.token.user |