replace payloadconfig with config in places
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
export default async function find(options) {
|
||||
import { FindOptions } from '../../../types';
|
||||
|
||||
export default async function find(options: FindOptions) {
|
||||
const {
|
||||
collection: collectionSlug,
|
||||
depth,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/* eslint-disable import/no-dynamic-require */
|
||||
/* eslint-disable global-require */
|
||||
import path from 'path';
|
||||
import { PayloadConfig } from './types';
|
||||
import { Config } from './types';
|
||||
import findConfig from './find';
|
||||
|
||||
const configPath = findConfig();
|
||||
const loadConfig = (): PayloadConfig => {
|
||||
const loadConfig = (): Config => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
let publicConfig = require(configPath);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import passport from 'passport';
|
||||
import { PayloadConfig } from '../../config/types';
|
||||
import { Payload } from '../../index';
|
||||
|
||||
export default (config: PayloadConfig) => {
|
||||
export default (config: Payload) => {
|
||||
const methods = config.collections.reduce((enabledMethods, collection) => {
|
||||
if (collection.auth && collection.auth.useAPIKey) {
|
||||
const collectionMethods = [...enabledMethods];
|
||||
|
||||
@@ -3,9 +3,9 @@ import crypto from 'crypto';
|
||||
import { TestAccount } from 'nodemailer';
|
||||
import { AuthenticateOptions } from 'passport';
|
||||
import {
|
||||
Config,
|
||||
EmailOptions,
|
||||
InitOptions,
|
||||
PayloadConfig,
|
||||
} from './config/types';
|
||||
import {
|
||||
Collection,
|
||||
@@ -51,7 +51,7 @@ require('isomorphic-fetch');
|
||||
* @description Payload
|
||||
*/
|
||||
export class Payload {
|
||||
config: PayloadConfig = loadConfig();
|
||||
config: Config = loadConfig();
|
||||
|
||||
collections: Collection[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user