feat: work on database adapter (#3000)

This commit is contained in:
Alessio Gravili
2023-07-17 19:22:51 +02:00
committed by GitHub
parent f1e23b1cd0
commit c8c22dad06
59 changed files with 160 additions and 113 deletions

View File

@@ -12,8 +12,9 @@ import { blocksFieldSeedData } from './collections/Blocks';
import { localizedTextValue, namedTabDefaultValue, namedTabText, tabsDoc, tabsSlug } from './collections/Tabs';
import { defaultNumber, numberDoc } from './collections/Number';
import { dateDoc } from './collections/Date';
import type { PaginatedDocs } from '../../src/mongoose/types';
import type { RichTextField } from './payload-types';
import type { PaginatedDocs } from '../../src/database/types';
import type { MongooseAdapter } from '../../src/mongoose';
let client;
let graphQLClient: GraphQLClient;
@@ -228,7 +229,7 @@ describe('Fields', () => {
const options: Record<string, IndexOptions> = {};
beforeAll(() => {
indexes = payload.collections['indexed-fields'].Model.schema.indexes() as [Record<string, IndexDirection>, IndexOptions];
indexes = (payload.db as MongooseAdapter).collections['indexed-fields'].schema.indexes() as [Record<string, IndexDirection>, IndexOptions];
indexes.forEach((index) => {
const field = Object.keys(index[0])[0];

View File

@@ -2,9 +2,9 @@
import qs from 'qs';
import fetch from 'node-fetch';
import type { Config } from '../../src/config/types';
import type { PaginatedDocs } from '../../src/mongoose/types';
import type { Where } from '../../src/types';
import { devUser } from '../credentials';
import type { PaginatedDocs } from '../../src/database/types';
type Args = {
serverURL: string;