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:
parent
571389d43b
commit
7a7724e66e
29 changed files with 493 additions and 208 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue