merge: improve Search and Search Widget (#268)

Closes #264
This commit is contained in:
Marie 2023-12-29 18:41:30 +01:00
commit fb99be79b9
2 changed files with 15 additions and 0 deletions

View file

@ -65,6 +65,11 @@ async function search() {
return;
}
if (query.match(/^@[a-z0-9_.-]+@[a-z0-9_.-]+$/i)) {
router.push(`/${query}`);
return;
}
userPagination.value = {
endpoint: 'users/search',
limit: 10,

View file

@ -117,6 +117,16 @@ async function search() {
return;
}
if (query.match(/^@[a-z0-9_.-]+@[a-z0-9_.-]+$/i)) {
router.push(`/${query}`);
return;
}
if (query.startsWith('#')) {
router.push(`/tags/${encodeURIComponent(query.substring(1))}`);
return;
}
notePagination.value = {
endpoint: 'notes/search',
limit: 10,