refactor: Pass app data within the constructor of an app
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { GraphQLString, GraphQLNonNull } from 'graphql';
|
||||
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
|
||||
import connectionType from '../types/connection';
|
||||
import App from '../../models/app';
|
||||
|
||||
type Params = {
|
||||
id: string;
|
||||
@@ -18,8 +19,9 @@ const testConnectionResolver = async (
|
||||
.throwIfNotFound();
|
||||
|
||||
const appClass = (await import(`../../apps/${connection.key}`)).default;
|
||||
const appData = App.findOneByKey(connection.key);
|
||||
|
||||
const appInstance = new appClass(connection.data);
|
||||
const appInstance = new appClass(appData, connection.data);
|
||||
const isStillVerified =
|
||||
await appInstance.authenticationClient.isStillVerified();
|
||||
|
||||
|
Reference in New Issue
Block a user