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; return;
} }
if (query.match(/^@[a-z0-9_.-]+@[a-z0-9_.-]+$/i)) {
router.push(`/${query}`);
return;
}
userPagination.value = { userPagination.value = {
endpoint: 'users/search', endpoint: 'users/search',
limit: 10, limit: 10,

View file

@ -117,6 +117,16 @@ async function search() {
return; 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 = { notePagination.value = {
endpoint: 'notes/search', endpoint: 'notes/search',
limit: 10, limit: 10,