Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #741 from Shinsina/allow-name-sort-search
Browse files Browse the repository at this point in the history
Allow NAME sort for default + passed in sortField, `marko-web-search`
  • Loading branch information
brandonbk authored Jul 12, 2023
2 parents b3e9d54 + 91cdbb8 commit ceca782
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/marko-web-search/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class MarkoWebSearchConfig {
Joi.number().integer().min(1).required(),
).default([]),

defaultSortField: Joi.string().allow('PUBLISHED', 'SCORE').default('PUBLISHED'),
defaultSortField: Joi.string().allow('NAME', 'PUBLISHED', 'SCORE').default('PUBLISHED'),
}).default(), params);

this.contentTypeObjects = contentTypes.sort().map((type) => (type.label ? ({
Expand Down
2 changes: 1 addition & 1 deletion packages/marko-web-search/config/query-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const fromArrayInput = (arr) => {
const toIntArrayInput = (arr) => toArrayInput(arr, (v) => parseInt(v, 10));
const toStringArrayInput = (arr) => toArrayInput(arr, (v) => v.trim());

const sortFieldSet = new Set(['PUBLISHED', 'SCORE']);
const sortFieldSet = new Set(['NAME', 'PUBLISHED', 'SCORE']);
const sortOrderSet = new Set(['DESC', 'ASC']);

class MarkoWebSearchQueryParamConfig {
Expand Down

0 comments on commit ceca782

Please sign in to comment.