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:
parent
7fed637506
commit
8dc8a34ee8
69 changed files with 278 additions and 263 deletions
|
@ -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: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue