fix: 🐛query search endpoint for local userselect, disregard host

This commit is contained in:
Kainoa Kanter 2023-07-04 01:29:57 +00:00
parent 0fa4dbf11d
commit 9de97d3ebd

View file

@ -23,7 +23,7 @@
</FormSplit>
</div>
<div
v-if="username != '' || host != ''"
v-if="username != ''"
class="result"
:class="{ hit: users.length > 0 }"
>
@ -54,7 +54,7 @@
<span>{{ i18n.ts.noUsers }}</span>
</div>
</div>
<div v-if="username == '' && host == ''" class="recent">
<div v-if="username == ''" class="recent">
<div class="users">
<div
v-for="user in recentUsers"
@ -100,20 +100,19 @@ const emit = defineEmits<{
}>();
let username = $ref("");
let host = $ref("");
let users: misskey.entities.UserDetailed[] = $ref([]);
let recentUsers: misskey.entities.UserDetailed[] = $ref([]);
let selected: misskey.entities.UserDetailed | null = $ref(null);
let dialogEl = $ref();
const search = () => {
if (username === "" && host === "") {
if (username === "") {
users = [];
return;
}
os.api("users/search-by-username-and-host", {
username: username,
host: null,
os.api("users/search", {
query: username,
origin: "local",
limit: 10,
detail: false,
}).then((_users) => {