Skip to content

Commit

Permalink
Rely on the default orderby options for now
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Feb 28, 2025
1 parent 27c04ea commit 924364c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/components/src/query-controls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ const QUERY_DEFAULTS = {

const MyQueryControls = () => {
const [ query, setQuery ] = useState( QUERY_DEFAULTS );
const { category, categories, maxItems, minItems, numberOfItems, order, orderBy, orderByOptions } = query;
const { category, categories, maxItems, minItems, numberOfItems, order, orderBy } = query;

const updateQuery = ( newQuery ) => {
setQuery( { ...query, ...newQuery } );
};

return (
<QueryControls
{ ...{ maxItems, minItems, numberOfItems, order, orderBy, orderByOptions } }
{ ...{ maxItems, minItems, numberOfItems, order, orderBy } }
onOrderByChange={ ( newOrderBy ) => updateQuery( { orderBy: newOrderBy } ) }
onOrderChange={ ( newOrder ) => updateQuery( { order: newOrder } ) }
categoriesList={ categories }
Expand Down Expand Up @@ -118,7 +118,7 @@ const MyQueryControls = () => {

return (
<QueryControls
{ ...{ orderBy, order, orderByOptions, numberOfItems } }
{ ...{ orderBy, order, numberOfItems } }
onOrderByChange={ ( newOrderBy ) => updateQuery( { orderBy: newOrderBy } ) }
onOrderChange={ ( newOrder ) => updateQuery( { order: newOrder } ) }
categorySuggestions={ categories }
Expand Down

0 comments on commit 924364c

Please sign in to comment.