From c4da3e89c5a02364e77e66dbe635a501bdb25e9a Mon Sep 17 00:00:00 2001 From: Youssef Date: Tue, 9 Nov 2021 20:55:23 +0100 Subject: [PATCH] fix: styling --- src/lib/routes/admin-api/user-splash-controller.ts | 3 ++- src/lib/routes/admin-api/user.ts | 9 +++++---- src/lib/types/stores.ts | 1 - .../20211109123505-add-cascade-for-user-splash.js | 10 +++++----- src/test/fixtures/fake-user-splash-store.ts | 6 +++--- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/lib/routes/admin-api/user-splash-controller.ts b/src/lib/routes/admin-api/user-splash-controller.ts index 87815ebd3a..68872fad54 100644 --- a/src/lib/routes/admin-api/user-splash-controller.ts +++ b/src/lib/routes/admin-api/user-splash-controller.ts @@ -14,6 +14,7 @@ interface ISplashBody { class UserSplashController extends Controller { private logger: Logger; + private userSplashService: UserSplashService; constructor( @@ -74,4 +75,4 @@ class UserSplashController extends Controller { } module.exports = UserSplashController; -export default UserSplashController; \ No newline at end of file +export default UserSplashController; diff --git a/src/lib/routes/admin-api/user.ts b/src/lib/routes/admin-api/user.ts index 3e13b4db19..a0449d1b8d 100644 --- a/src/lib/routes/admin-api/user.ts +++ b/src/lib/routes/admin-api/user.ts @@ -63,14 +63,15 @@ class UserController extends Controller { const feedback = await this.userFeedbackService.getAllUserFeedback( user, ); - const splash = await this.userSplashService.getAllUserSplashs( - user, - ); + const splash = await this.userSplashService.getAllUserSplashs(user); // TODO: remove this line after we remove it from db. delete user.permissions; - return res.status(200).json({ user, permissions, feedback, splash }).end(); + return res + .status(200) + .json({ user, permissions, feedback, splash }) + .end(); } async updateUserPass( diff --git a/src/lib/types/stores.ts b/src/lib/types/stores.ts index ff09b606a5..cb92c0c44a 100644 --- a/src/lib/types/stores.ts +++ b/src/lib/types/stores.ts @@ -25,7 +25,6 @@ import { IFeatureToggleClientStore } from './stores/feature-toggle-client-store' import { IClientMetricsStoreV2 } from './stores/client-metrics-store-v2'; import { IUserSplashStore } from './stores/user-splash-store'; - export interface IUnleashStores { accessStore: IAccessStore; addonStore: IAddonStore; diff --git a/src/migrations/20211109123505-add-cascade-for-user-splash.js b/src/migrations/20211109123505-add-cascade-for-user-splash.js index 9a62b4e4e8..5f9754c440 100644 --- a/src/migrations/20211109123505-add-cascade-for-user-splash.js +++ b/src/migrations/20211109123505-add-cascade-for-user-splash.js @@ -1,16 +1,16 @@ exports.up = function (db, cb) { - db.runSql( - ` + db.runSql( + ` ALTER TABLE user_splash DROP CONSTRAINT user_splash_user_id_fkey; ALTER TABLE user_splash ADD CONSTRAINT user_splash_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; `, - cb, - ); + cb, + ); }; exports.down = function (db, cb) { - db.runSql('', cb); + db.runSql('', cb); }; diff --git a/src/test/fixtures/fake-user-splash-store.ts b/src/test/fixtures/fake-user-splash-store.ts index adc0775c7b..5b3c6e8331 100644 --- a/src/test/fixtures/fake-user-splash-store.ts +++ b/src/test/fixtures/fake-user-splash-store.ts @@ -2,7 +2,7 @@ import { IUserSplashKey, IUserSplash, IUserSplashStore, -} from '../../lib/types/stores/user-splash-store' +} from '../../lib/types/stores/user-splash-store'; export default class FakeUserSplashStore implements IUserSplashStore { // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -11,12 +11,12 @@ export default class FakeUserSplashStore implements IUserSplashStore { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - getSplash(userId: number, splashId: string): Promise { + getSplash(userId: number, splashId: string): Promise { return Promise.resolve(undefined); } // eslint-disable-next-line @typescript-eslint/no-unused-vars - updateSplash(splash: IUserSplash): Promise { + updateSplash(splash: IUserSplash): Promise { return Promise.resolve(undefined); }