aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-17 11:28:11 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-17 11:28:11 +0200
commit154898b0b7bc1af41fc5a94974e338a3590c90f3 (patch)
tree5fb90f66da7587aed53c99ac1884c7acd0c1f7ca /server/controllers/api/users.ts
parentdf98563e2104b82b119c00a3cd83cd0dc1242d25 (diff)
downloadPeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.gz
PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.zst
PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.zip
Share models between server and client
Diffstat (limited to 'server/controllers/api/users.ts')
-rw-r--r--server/controllers/api/users.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts
index ffe5881e5..1e9e65689 100644
--- a/server/controllers/api/users.ts
+++ b/server/controllers/api/users.ts
@@ -17,6 +17,7 @@ import {
17 setUsersSort, 17 setUsersSort,
18 token 18 token
19} from '../../middlewares' 19} from '../../middlewares'
20import { UserVideoRate as FormatedUserVideoRate } from '../../../shared'
20 21
21const usersRouter = express.Router() 22const usersRouter = express.Router()
22 23
@@ -119,10 +120,11 @@ function getUserVideoRating (req: express.Request, res: express.Response, next:
119 120
120 const rating = ratingObj ? ratingObj.type : 'none' 121 const rating = ratingObj ? ratingObj.type : 'none'
121 122
122 res.json({ 123 const json: FormatedUserVideoRate = {
123 videoId, 124 videoId,
124 rating 125 rating
125 }) 126 }
127 res.json(json)
126 }) 128 })
127} 129}
128 130