1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Avoir some circular dependencies

This commit is contained in:
Chocobozzz 2020-04-23 09:32:53 +02:00 committed by Chocobozzz
parent 7fed637506
commit 8dc8a34ee8
69 changed files with 278 additions and 263 deletions

View file

@ -1,5 +1,16 @@
import { AllowNull, Column, Default, DefaultScope, HasOne, IsInt, Model, Table } from 'sequelize-typescript'
import { AccountModel } from '../account/account'
import * as memoizee from 'memoizee'
export const getServerActor = memoizee(async function () {
const application = await ApplicationModel.load()
if (!application) throw Error('Could not load Application from database.')
const actor = application.Account.Actor
actor.Account = application.Account
return actor
}, { promise: true })
@DefaultScope(() => ({
include: [