aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-08-25 11:45:31 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-08-25 11:45:31 +0200
commit0aef76c479bc7fc758e70e1cd478ade46761b51b (patch)
treeed59eae3ee731c56d25cc35a382f4cc400d0dece /server/controllers/api/users.ts
parent93e1258c7cbc0d1235ca6d2a1f7c1875985328b8 (diff)
downloadPeerTube-0aef76c479bc7fc758e70e1cd478ade46761b51b.tar.gz
PeerTube-0aef76c479bc7fc758e70e1cd478ade46761b51b.tar.zst
PeerTube-0aef76c479bc7fc758e70e1cd478ade46761b51b.zip
Formated -> Formatted
Diffstat (limited to 'server/controllers/api/users.ts')
-rw-r--r--server/controllers/api/users.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts
index f50dbc9a3..04d885185 100644
--- a/server/controllers/api/users.ts
+++ b/server/controllers/api/users.ts
@@ -2,7 +2,7 @@ import * as express from 'express'
2 2
3import { database as db } from '../../initializers/database' 3import { database as db } from '../../initializers/database'
4import { USER_ROLES } from '../../initializers' 4import { USER_ROLES } from '../../initializers'
5import { logger, getFormatedObjects } from '../../helpers' 5import { logger, getFormattedObjects } from '../../helpers'
6import { 6import {
7 authenticate, 7 authenticate,
8 ensureIsAdmin, 8 ensureIsAdmin,
@@ -17,7 +17,7 @@ import {
17 setUsersSort, 17 setUsersSort,
18 token 18 token
19} from '../../middlewares' 19} from '../../middlewares'
20import { UserVideoRate as FormatedUserVideoRate, UserCreate, UserUpdate } from '../../../shared' 20import { UserVideoRate as FormattedUserVideoRate, UserCreate, UserUpdate } from '../../../shared'
21 21
22const usersRouter = express.Router() 22const usersRouter = express.Router()
23 23
@@ -95,7 +95,7 @@ function createUser (req: express.Request, res: express.Response, next: express.
95 95
96function getUserInformation (req: express.Request, res: express.Response, next: express.NextFunction) { 96function getUserInformation (req: express.Request, res: express.Response, next: express.NextFunction) {
97 db.User.loadByUsername(res.locals.oauth.token.user.username) 97 db.User.loadByUsername(res.locals.oauth.token.user.username)
98 .then(user => res.json(user.toFormatedJSON())) 98 .then(user => res.json(user.toFormattedJSON()))
99 .catch(err => next(err)) 99 .catch(err => next(err))
100} 100}
101 101
@@ -106,7 +106,7 @@ function getUserVideoRating (req: express.Request, res: express.Response, next:
106 db.UserVideoRate.load(userId, videoId, null) 106 db.UserVideoRate.load(userId, videoId, null)
107 .then(ratingObj => { 107 .then(ratingObj => {
108 const rating = ratingObj ? ratingObj.type : 'none' 108 const rating = ratingObj ? ratingObj.type : 'none'
109 const json: FormatedUserVideoRate = { 109 const json: FormattedUserVideoRate = {
110 videoId, 110 videoId,
111 rating 111 rating
112 } 112 }
@@ -118,7 +118,7 @@ function getUserVideoRating (req: express.Request, res: express.Response, next:
118function listUsers (req: express.Request, res: express.Response, next: express.NextFunction) { 118function listUsers (req: express.Request, res: express.Response, next: express.NextFunction) {
119 db.User.listForApi(req.query.start, req.query.count, req.query.sort) 119 db.User.listForApi(req.query.start, req.query.count, req.query.sort)
120 .then(resultList => { 120 .then(resultList => {
121 res.json(getFormatedObjects(resultList.data, resultList.total)) 121 res.json(getFormattedObjects(resultList.data, resultList.total))
122 }) 122 })
123 .catch(err => next(err)) 123 .catch(err => next(err))
124} 124}