From e2209ec85c9bb59fb2b8f69a4f77370ce2664b88 Mon Sep 17 00:00:00 2001 From: Espen Hovlandsdal Date: Fri, 16 Dec 2022 14:22:17 -0800 Subject: [PATCH] refactor(desk): remove unused default ordering option in `useDocumentList` --- .../sanity/src/desk/panes/documentList/DocumentListPane.tsx | 1 - packages/sanity/src/desk/panes/documentList/useDocumentList.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/sanity/src/desk/panes/documentList/DocumentListPane.tsx b/packages/sanity/src/desk/panes/documentList/DocumentListPane.tsx index 9f376b44937..a02f0e73381 100644 --- a/packages/sanity/src/desk/panes/documentList/DocumentListPane.tsx +++ b/packages/sanity/src/desk/panes/documentList/DocumentListPane.tsx @@ -76,7 +76,6 @@ export const DocumentListPane = memo(function DocumentListPane(props: DocumentLi const filterIsSimpleTypeContraint = isSimpleTypeFilter(filter) const {error, fullList, handleListChange, isLoading, items, onRetry} = useDocumentList({ - defaultOrdering, filter, params, sortOrder, diff --git a/packages/sanity/src/desk/panes/documentList/useDocumentList.ts b/packages/sanity/src/desk/panes/documentList/useDocumentList.ts index 08af4c08451..e8e1b1c9414 100644 --- a/packages/sanity/src/desk/panes/documentList/useDocumentList.ts +++ b/packages/sanity/src/desk/panes/documentList/useDocumentList.ts @@ -2,14 +2,13 @@ import {VirtualListChangeOpts} from '@sanity/ui' import {useEffect, useState, useCallback, useMemo, useRef} from 'react' import {of} from 'rxjs' import {filter as filterEvents} from 'rxjs/operators' -import {DocumentListPaneItem, QueryResult, SortOrder, SortOrderBy} from './types' +import {DocumentListPaneItem, QueryResult, SortOrder} from './types' import {removePublishedWithDrafts, toOrderClause} from './helpers' import {DEFAULT_ORDERING, FULL_LIST_LIMIT, PARTIAL_PAGE_LIMIT} from './constants' import {getQueryResults} from './getQueryResults' import {DEFAULT_STUDIO_CLIENT_OPTIONS, useClient} from 'sanity' interface UseDocumentListOpts { - defaultOrdering: SortOrderBy[] filter: string params: Record sortOrder?: SortOrder