mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Add comments controller
This commit is contained in:
parent
6d85247028
commit
bf1f650817
11 changed files with 464 additions and 99 deletions
16
server/helpers/custom-validators/video-comments.ts
Normal file
16
server/helpers/custom-validators/video-comments.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import 'express-validator'
|
||||
import 'multer'
|
||||
import * as validator from 'validator'
|
||||
import { CONSTRAINTS_FIELDS } from '../../initializers'
|
||||
|
||||
const VIDEO_COMMENTS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_COMMENTS
|
||||
|
||||
function isValidVideoCommentText (value: string) {
|
||||
return value === null || validator.isLength(value, VIDEO_COMMENTS_CONSTRAINTS_FIELDS.TEXT)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
isValidVideoCommentText
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue