]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/oauth/oauth-client.ts
Fix lint
[github/Chocobozzz/PeerTube.git] / server / models / oauth / oauth-client.ts
index b4a841edd82386db4b7328f59c68958d21f0865c..457e846137f94a79f8a8dad70ae3c6e6e7e46a10 100644 (file)
@@ -1,4 +1,5 @@
 import { AllowNull, Column, CreatedAt, DataType, HasMany, Model, Table, UpdatedAt } from 'sequelize-typescript'
+import { AttributesOnly } from '@shared/typescript-utils'
 import { OAuthTokenModel } from './oauth-token'
 
 @Table({
@@ -14,7 +15,7 @@ import { OAuthTokenModel } from './oauth-token'
     }
   ]
 })
-export class OAuthClientModel extends Model<OAuthClientModel> {
+export class OAuthClientModel extends Model<Partial<AttributesOnly<OAuthClientModel>>> {
 
   @AllowNull(false)
   @Column
@@ -24,10 +25,10 @@ export class OAuthClientModel extends Model<OAuthClientModel> {
   @Column
   clientSecret: string
 
-  @Column({ type: DataType.ARRAY(DataType.STRING) }) // FIXME: sequelize typings
+  @Column(DataType.ARRAY(DataType.STRING))
   grants: string[]
 
-  @Column({ type: DataType.ARRAY(DataType.STRING) }) // FIXME: sequelize typings
+  @Column(DataType.ARRAY(DataType.STRING))
   redirectUris: string[]
 
   @CreatedAt
@@ -52,8 +53,8 @@ export class OAuthClientModel extends Model<OAuthClientModel> {
   static getByIdAndSecret (clientId: string, clientSecret: string) {
     const query = {
       where: {
-        clientId: clientId,
-        clientSecret: clientSecret
+        clientId,
+        clientSecret
       }
     }