From 1129711f75697016b9a8482cda4f03a6dfc6ebcc Mon Sep 17 00:00:00 2001 From: James Date: Wed, 2 Dec 2020 15:24:14 -0500 Subject: [PATCH] adds sort to local find operation --- src/collections/operations/local/find.ts | 2 ++ src/types/index.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/collections/operations/local/find.ts b/src/collections/operations/local/find.ts index 09e14b09cb..8345e32e9c 100644 --- a/src/collections/operations/local/find.ts +++ b/src/collections/operations/local/find.ts @@ -12,12 +12,14 @@ export default async function find(options: FindOptions) { user, overrideAccess = true, showHiddenFields, + sort, } = options; const collection = this.collections[collectionSlug]; return this.operations.collections.find({ depth, + sort, page, limit, where, diff --git a/src/types/index.ts b/src/types/index.ts index 9b609cf131..31ecb0d5f3 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -25,6 +25,7 @@ export type FindOptions = { where?: { [key: string]: unknown }; depth?: number; limit?: number; + sort?: string; }; export type FindResponse = {