X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fuser.ts;h=ac5f55260ea5b68e290b463cbcd072f13578ff30;hb=c1e791bad0b079af67398f6407221e6dcbb573dd;hp=51050de9b2a927a7fcb3f238d7f5f3f95680b71a;hpb=5f7021c33d31c5255b995ae0ff86b5bbea4ea4b9;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/user.ts b/server/lib/user.ts index 51050de9b..ac5f55260 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts @@ -6,6 +6,7 @@ import { UserModel } from '../models/account/user' import { buildActorInstance, getAccountActivityPubUrl, setAsyncActorKeys } from './activitypub' import { createVideoChannel } from './video-channel' import { VideoChannelModel } from '../models/video/video-channel' +import { FilteredModelAttributes } from 'sequelize-typescript/lib/models/Model' async function createUserAccountAndChannel (userToCreate: UserModel, validateUser = true) { const { user, account, videoChannel } = await sequelizeTypescript.transaction(async t => { @@ -34,9 +35,9 @@ async function createUserAccountAndChannel (userToCreate: UserModel, validateUse async function createLocalAccountWithoutKeys ( name: string, - userId: number, - applicationId: number, - t: Sequelize.Transaction, + userId: number | null, + applicationId: number | null, + t: Sequelize.Transaction | undefined, type: ActivityPubActorType= 'Person' ) { const url = getAccountActivityPubUrl(name) @@ -49,7 +50,7 @@ async function createLocalAccountWithoutKeys ( userId, applicationId, actorId: actorInstanceCreated.id - }) + } as FilteredModelAttributes) const accountInstanceCreated = await accountInstance.save({ transaction: t }) accountInstanceCreated.Actor = actorInstanceCreated