From 39445ead45aaaea801ec09991b8dd2464f722e47 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 23 Nov 2017 17:36:15 +0100 Subject: Cleanup models --- server/models/oauth/oauth-token.ts | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'server/models/oauth/oauth-token.ts') diff --git a/server/models/oauth/oauth-token.ts b/server/models/oauth/oauth-token.ts index c7afcc38c..a82bff130 100644 --- a/server/models/oauth/oauth-token.ts +++ b/server/models/oauth/oauth-token.ts @@ -3,19 +3,12 @@ import * as Sequelize from 'sequelize' import { logger } from '../../helpers' import { addMethodsToModel } from '../utils' -import { - OAuthTokenInstance, - OAuthTokenAttributes, - - OAuthTokenMethods, - OAuthTokenInfo -} from './oauth-token-interface' +import { OAuthTokenAttributes, OAuthTokenInfo, OAuthTokenInstance, OAuthTokenMethods } from './oauth-token-interface' let OAuthToken: Sequelize.Model let getByRefreshTokenAndPopulateClient: OAuthTokenMethods.GetByRefreshTokenAndPopulateClient let getByTokenAndPopulateUser: OAuthTokenMethods.GetByTokenAndPopulateUser let getByRefreshTokenAndPopulateUser: OAuthTokenMethods.GetByRefreshTokenAndPopulateUser -let removeByUserId: OAuthTokenMethods.RemoveByUserId export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) { OAuthToken = sequelize.define('OAuthToken', @@ -62,8 +55,7 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da getByRefreshTokenAndPopulateClient, getByTokenAndPopulateUser, - getByRefreshTokenAndPopulateUser, - removeByUserId + getByRefreshTokenAndPopulateUser ] addMethodsToModel(OAuthToken, classMethods) @@ -170,13 +162,3 @@ getByRefreshTokenAndPopulateUser = function (refreshToken: string) { return token }) } - -removeByUserId = function (userId: number) { - const query = { - where: { - userId: userId - } - } - - return OAuthToken.destroy(query) -} -- cgit v1.2.3