Adjust autocomplete batch size

This commit is contained in:
Piotr Rogowski 2023-09-19 13:29:50 +02:00
parent 54b71dea19
commit 6af0f62fc9
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
2 changed files with 1 additions and 3 deletions

View File

@ -170,7 +170,7 @@ const useDb = () => {
const autocomplete = async (attribute: string, search: string): Promise<TunesResponse[]> => {
try {
const items = await tunesCollection.getFullList<TunesResponse>(10, {
const items = await tunesCollection.getFullList<TunesResponse>({
filter: `${attribute} ~ "${search}"`,
});

View File

@ -148,8 +148,6 @@ const UploadPage = () => {
}
const options = (await autocomplete(attribute, search)).map((record) => record[attribute]);
// TODO: order by occurrence (more common - higher in the list)
const unique = [...new Set(options)].map((value) => ({ value }));
setAutocompleteOptions((prev) => ({ ...prev, [attribute]: unique }));