1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

add video upload types, add doc middleware to more routes

This commit is contained in:
Rigel Kent 2021-06-06 10:21:06 +02:00
parent fc21ef5c62
commit c756bae079
No known key found for this signature in database
GPG key ID: 5E53E96A494E452F
6 changed files with 88 additions and 21 deletions

View file

@ -1,12 +1,19 @@
import * as express from 'express'
import { UserWatchingVideo } from '../../../../shared'
import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoWatchingValidator } from '../../../middlewares'
import {
asyncMiddleware,
asyncRetryTransactionMiddleware,
authenticate,
openapiOperationDoc,
videoWatchingValidator
} from '../../../middlewares'
import { UserVideoHistoryModel } from '../../../models/user/user-video-history'
import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
const watchingRouter = express.Router()
watchingRouter.put('/:videoId/watching',
openapiOperationDoc({ operationId: 'setProgress' }),
authenticate,
asyncMiddleware(videoWatchingValidator),
asyncRetryTransactionMiddleware(userWatchVideo)