X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fserver%2Fserver.ts;h=25d9924fb33e7f91b8fc1f8bb6be01fa002ea8cb;hb=5ec3cbdf22fc88ebe57f370fc0bc0e3df7453458;hp=7712007971b7bd2108749642788a94687cb3556d;hpb=26d6bf6533023326fa017812cf31bbe20c752d36;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/server/server.ts b/server/models/server/server.ts index 771200797..25d9924fb 100644 --- a/server/models/server/server.ts +++ b/server/models/server/server.ts @@ -1,10 +1,10 @@ import { AllowNull, Column, CreatedAt, Default, HasMany, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' +import { MServer, MServerFormattable } from '@server/types/models/server' +import { AttributesOnly } from '@shared/core-utils' import { isHostValid } from '../../helpers/custom-validators/servers' -import { ActorModel } from '../activitypub/actor' +import { ActorModel } from '../actor/actor' import { throwIfNotValid } from '../utils' import { ServerBlocklistModel } from './server-blocklist' -import * as Bluebird from 'bluebird' -import { MServer, MServerFormattable } from '@server/types/models/server' @Table({ tableName: 'server', @@ -15,7 +15,7 @@ import { MServer, MServerFormattable } from '@server/types/models/server' } ] }) -export class ServerModel extends Model { +export class ServerModel extends Model>> { @AllowNull(false) @Is('Host', value => throwIfNotValid(value, isHostValid, 'valid host')) @@ -51,7 +51,7 @@ export class ServerModel extends Model { }) BlockedByAccounts: ServerBlocklistModel[] - static load (id: number): Bluebird { + static load (id: number): Promise { const query = { where: { id @@ -61,7 +61,7 @@ export class ServerModel extends Model { return ServerModel.findOne(query) } - static loadByHost (host: string): Bluebird { + static loadByHost (host: string): Promise { const query = { where: { host