Allow searching author, closes #802

This commit is contained in:
Piotr Rogowski 2022-10-30 14:31:12 +01:00
parent a290b4fb0b
commit 4262411b58
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
1 changed files with 2 additions and 2 deletions

View File

@ -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 {