Allow searching author, closes #802
This commit is contained in:
parent
a290b4fb0b
commit
4262411b58
|
@ -92,10 +92,10 @@ const useDb = () => {
|
|||
};
|
||||
|
||||
const searchTunes = async (search: string, page: number, perPage: number) => {
|
||||
const phrases = search.length > 0 ? search.replace(/ +(?= )/g,'').split(' ') : [];
|
||||
const phrases = search.length > 0 ? search.replace(/ +(?= )/g, '').split(' ') : [];
|
||||
const filter = phrases
|
||||
.filter((phrase) => phrase.length > 1)
|
||||
.map((phrase) => `textSearch ~ "${phrase}"`)
|
||||
.map((phrase) => `textSearch ~ "${phrase}" || author.username ~ "${phrase}"`)
|
||||
.join(' && ');
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue