1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Add migration script for channels

This commit is contained in:
Chocobozzz 2017-10-26 08:51:11 +02:00
parent bcd9f81eff
commit faab3a8453
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 121 additions and 11 deletions

View file

@ -158,16 +158,14 @@ async function getUserVideoRating (req: express.Request, res: express.Response,
const videoId = +req.params.videoId
const userId = +res.locals.oauth.token.User.id
db.UserVideoRate.load(userId, videoId, null)
.then(ratingObj => {
const rating = ratingObj ? ratingObj.type : 'none'
const json: FormattedUserVideoRate = {
videoId,
rating
}
res.json(json)
})
.catch(err => next(err))
const ratingObj = await db.UserVideoRate.load(userId, videoId, null)
const rating = ratingObj ? ratingObj.type : 'none'
const json: FormattedUserVideoRate = {
videoId,
rating
}
res.json(json)
}
async function listUsers (req: express.Request, res: express.Response, next: express.NextFunction) {