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

Handle follow/accept

This commit is contained in:
Chocobozzz 2017-11-13 17:39:41 +01:00
parent 571389d43b
commit 7a7724e66e
No known key found for this signature in database
GPG key ID: 583A612D890159BE
29 changed files with 493 additions and 208 deletions

View file

@ -5,6 +5,7 @@ import { pseudoRandomBytesPromise } from './core-utils'
import { CONFIG, database as db } from '../initializers'
import { ResultList } from '../../shared'
import { VideoResolution } from '../../shared/models/videos/video-resolution.enum'
import { AccountInstance } from '../models/account/account-interface'
function badRequest (req: express.Request, res: express.Response, next: express.NextFunction) {
return res.type('json').status(400).end()
@ -78,6 +79,15 @@ function resetSequelizeInstance (instance: Sequelize.Instance<any>, savedFields:
})
}
let applicationAccount: AccountInstance
async function getApplicationAccount () {
if (applicationAccount === undefined) {
applicationAccount = await db.Account.loadApplication()
}
return Promise.resolve(applicationAccount)
}
type SortType = { sortModel: any, sortValue: string }
// ---------------------------------------------------------------------------
@ -89,5 +99,6 @@ export {
isSignupAllowed,
computeResolutionsToTranscode,
resetSequelizeInstance,
getApplicationAccount,
SortType
}