aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-26 08:51:11 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-26 09:11:38 +0200
commitfaab3a8453e2af92f95518e55e00293ac140b6e8 (patch)
tree833254b15e1f421b3e8da4dfdb323ef2ed8cfe69 /server/controllers/api
parentbcd9f81eff05ffd930c5d8175fb907d4d371432a (diff)
downloadPeerTube-faab3a8453e2af92f95518e55e00293ac140b6e8.tar.gz
PeerTube-faab3a8453e2af92f95518e55e00293ac140b6e8.tar.zst
PeerTube-faab3a8453e2af92f95518e55e00293ac140b6e8.zip
Add migration script for channels
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/users.ts18
1 files changed, 8 insertions, 10 deletions
diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts
index b49d37d4e..18a094f03 100644
--- a/server/controllers/api/users.ts
+++ b/server/controllers/api/users.ts
@@ -158,16 +158,14 @@ async function getUserVideoRating (req: express.Request, res: express.Response,
158 const videoId = +req.params.videoId 158 const videoId = +req.params.videoId
159 const userId = +res.locals.oauth.token.User.id 159 const userId = +res.locals.oauth.token.User.id
160 160
161 db.UserVideoRate.load(userId, videoId, null) 161 const ratingObj = await db.UserVideoRate.load(userId, videoId, null)
162 .then(ratingObj => { 162 const rating = ratingObj ? ratingObj.type : 'none'
163 const rating = ratingObj ? ratingObj.type : 'none' 163
164 const json: FormattedUserVideoRate = { 164 const json: FormattedUserVideoRate = {
165 videoId, 165 videoId,
166 rating 166 rating
167 } 167 }
168 res.json(json) 168 res.json(json)
169 })
170 .catch(err => next(err))
171} 169}
172 170
173async function listUsers (req: express.Request, res: express.Response, next: express.NextFunction) { 171async function listUsers (req: express.Request, res: express.Response, next: express.NextFunction) {