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

Formated -> Formatted

This commit is contained in:
Chocobozzz 2017-08-25 11:45:31 +02:00
parent 93e1258c7c
commit 0aef76c479
17 changed files with 63 additions and 63 deletions

View file

@ -5,7 +5,7 @@ import { CONFIG } from '../../initializers'
import {
logger,
getMyPublicCert,
getFormatedObjects
getFormattedObjects
} from '../../helpers'
import {
sendOwnedVideosToPod,
@ -25,7 +25,7 @@ import {
import {
PodInstance
} from '../../models'
import { Pod as FormatedPod } from '../../../shared'
import { Pod as FormattedPod } from '../../../shared'
const podsRouter = express.Router()
@ -81,7 +81,7 @@ function addPods (req: express.Request, res: express.Response, next: express.Nex
function listPods (req: express.Request, res: express.Response, next: express.NextFunction) {
db.Pod.list()
.then(podsList => res.json(getFormatedObjects<FormatedPod, PodInstance>(podsList, podsList.length)))
.then(podsList => res.json(getFormattedObjects<FormattedPod, PodInstance>(podsList, podsList.length)))
.catch(err => next(err))
}

View file

@ -2,7 +2,7 @@ import * as express from 'express'
import { database as db } from '../../initializers/database'
import { USER_ROLES } from '../../initializers'
import { logger, getFormatedObjects } from '../../helpers'
import { logger, getFormattedObjects } from '../../helpers'
import {
authenticate,
ensureIsAdmin,
@ -17,7 +17,7 @@ import {
setUsersSort,
token
} from '../../middlewares'
import { UserVideoRate as FormatedUserVideoRate, UserCreate, UserUpdate } from '../../../shared'
import { UserVideoRate as FormattedUserVideoRate, UserCreate, UserUpdate } from '../../../shared'
const usersRouter = express.Router()
@ -95,7 +95,7 @@ function createUser (req: express.Request, res: express.Response, next: express.
function getUserInformation (req: express.Request, res: express.Response, next: express.NextFunction) {
db.User.loadByUsername(res.locals.oauth.token.user.username)
.then(user => res.json(user.toFormatedJSON()))
.then(user => res.json(user.toFormattedJSON()))
.catch(err => next(err))
}
@ -106,7 +106,7 @@ function getUserVideoRating (req: express.Request, res: express.Response, next:
db.UserVideoRate.load(userId, videoId, null)
.then(ratingObj => {
const rating = ratingObj ? ratingObj.type : 'none'
const json: FormatedUserVideoRate = {
const json: FormattedUserVideoRate = {
videoId,
rating
}
@ -118,7 +118,7 @@ function getUserVideoRating (req: express.Request, res: express.Response, next:
function listUsers (req: express.Request, res: express.Response, next: express.NextFunction) {
db.User.listForApi(req.query.start, req.query.count, req.query.sort)
.then(resultList => {
res.json(getFormatedObjects(resultList.data, resultList.total))
res.json(getFormattedObjects(resultList.data, resultList.total))
})
.catch(err => next(err))
}

View file

@ -4,7 +4,7 @@ import { database as db } from '../../../initializers/database'
import * as friends from '../../../lib/friends'
import {
logger,
getFormatedObjects,
getFormattedObjects,
retryTransactionWrapper
} from '../../../helpers'
import {
@ -46,7 +46,7 @@ export {
function listVideoAbuses (req: express.Request, res: express.Response, next: express.NextFunction) {
db.VideoAbuse.listForApi(req.query.start, req.query.count, req.query.sort)
.then(result => res.json(getFormatedObjects(result.data, result.total)))
.then(result => res.json(getFormattedObjects(result.data, result.total)))
.catch(err => next(err))
}

View file

@ -36,7 +36,7 @@ import {
logger,
retryTransactionWrapper,
generateRandomString,
getFormatedObjects,
getFormattedObjects,
renamePromise
} from '../../../helpers'
import { TagInstance } from '../../../models'
@ -386,12 +386,12 @@ function getVideo (req: express.Request, res: express.Response, next: express.Ne
}
// Do not wait the view system
res.json(videoInstance.toFormatedJSON())
res.json(videoInstance.toFormattedJSON())
}
function listVideos (req: express.Request, res: express.Response, next: express.NextFunction) {
db.Video.listForApi(req.query.start, req.query.count, req.query.sort)
.then(result => res.json(getFormatedObjects(result.data, result.total)))
.then(result => res.json(getFormattedObjects(result.data, result.total)))
.catch(err => next(err))
}
@ -408,6 +408,6 @@ function removeVideo (req: express.Request, res: express.Response, next: express
function searchVideos (req: express.Request, res: express.Response, next: express.NextFunction) {
db.Video.searchAndPopulateAuthorAndPodAndTags(req.params.value, req.query.field, req.query.start, req.query.count, req.query.sort)
.then(result => res.json(getFormatedObjects(result.data, result.total)))
.then(result => res.json(getFormattedObjects(result.data, result.total)))
.catch(err => next(err))
}