chore: binds prefs model even if not local

This commit is contained in:
James
2022-12-05 10:24:31 -05:00
parent b70dc83d0e
commit b6ec4bd2d4
3 changed files with 5 additions and 4 deletions

View File

@@ -29,6 +29,7 @@ import loadConfig from './config/load';
import Logger from './utilities/logger';
import { getDataLoader } from './collections/dataloader';
import mountEndpoints from './express/mountEndpoints';
import PreferencesModel from './preferences/model';
export const init = (payload: Payload, options: InitOptions): void => {
payload.logger.info('Starting Payload...');
@@ -71,6 +72,9 @@ export const init = (payload: Payload, options: InitOptions): void => {
if (!payload.config.graphQL.disable) {
registerSchema(payload);
}
payload.preferences = { Model: PreferencesModel };
// If not initializing locally, set up HTTP routing
if (!payload.local) {
options.express.use((req: PayloadRequest, res, next) => {