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

Video channel API routes refractor

This commit is contained in:
Chocobozzz 2018-04-25 10:21:38 +02:00
parent 48dce1c90d
commit 6b738c7a31
No known key found for this signature in database
GPG key ID: 583A612D890159BE
18 changed files with 383 additions and 141 deletions

View file

@ -5,6 +5,7 @@ import { AccountModel } from '../models/account/account'
import { UserModel } from '../models/account/user'
import { buildActorInstance, getAccountActivityPubUrl, setAsyncActorKeys } from './activitypub'
import { createVideoChannel } from './video-channel'
import { VideoChannelModel } from '../models/video/video-channel'
async function createUserAccountAndChannel (userToCreate: UserModel, validateUser = true) {
const { user, account, videoChannel } = await sequelizeTypescript.transaction(async t => {
@ -28,7 +29,7 @@ async function createUserAccountAndChannel (userToCreate: UserModel, validateUse
account.Actor = await setAsyncActorKeys(account.Actor)
videoChannel.Actor = await setAsyncActorKeys(videoChannel.Actor)
return { user, account, videoChannel }
return { user, account, videoChannel } as { user: UserModel, account: AccountModel, videoChannel: VideoChannelModel }
}
async function createLocalAccountWithoutKeys (