-import * as Bluebird from 'bluebird'
import { Op } from 'sequelize'
import { BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'
import { MServerBlocklist, MServerBlocklistAccountServer, MServerBlocklistFormattable } from '@server/types/models'
+import { AttributesOnly } from '@shared/core-utils'
import { ServerBlock } from '@shared/models'
import { AccountModel } from '../account/account'
import { getSort, searchAttribute } from '../utils'
}
]
})
-export class ServerBlocklistModel extends Model<ServerBlocklistModel> {
+export class ServerBlocklistModel extends Model<Partial<AttributesOnly<ServerBlocklistModel>>> {
@CreatedAt
createdAt: Date
})
}
- static loadByAccountAndHost (accountId: number, host: string): Bluebird<MServerBlocklist> {
+ static loadByAccountAndHost (accountId: number, host: string): Promise<MServerBlocklist> {
const query = {
where: {
accountId
return ServerBlocklistModel.findOne(query)
}
- static listHostsBlockedBy (accountIds: number[]): Bluebird<string[]> {
+ static listHostsBlockedBy (accountIds: number[]): Promise<string[]> {
const query = {
attributes: [ ],
where: {