Skip to content

Commit 006cf95

Browse files
shinyichenthostetler
authored andcommitted
default sort search by orcid id by date
1 parent 1078502 commit 006cf95

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/AllAuthorsModal/AllAuthorsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const AllAuthorsModal = ({ bibcode, label }: IAllAuthorsModalProps): Reac
138138
};
139139

140140
const createQuery = (type: 'author' | 'orcid', value: string): IADSApiSearchParams => {
141-
return { q: `${type}:"${value}"`, sort: ['score desc'] };
141+
return { q: `${type}:"${value}"`, sort: type === 'author' ? ['score desc'] : ['date desc'] };
142142
};
143143

144144
const AuthorsTable = forwardRef<HTMLInputElement, { doc: IDocsEntity; onSearchClear: () => void }>(

src/pages/abs/[id]/abstract.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const AllAuthorsModal = dynamic<IAllAuthorsModalProps>(
3939
const MAX = APP_DEFAULTS.DETAILS_MAX_AUTHORS;
4040

4141
const createQuery = (type: 'author' | 'orcid', value: string): IADSApiSearchParams => {
42-
return { q: `${type}:"${value}"`, sort: ['score desc'] };
42+
return { q: `${type}:"${value}"`, sort: type === 'author' ? ['score desc'] : ['date desc'] };
4343
};
4444

4545
const safeDecode = (value?: string) => {

0 commit comments

Comments
 (0)