mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: remove /user/search
This commit is contained in:
1 parent
6762e22bae
commit
5c97bbf1ba
8 files changed
+74
-48
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
import request from 'vj/utils/request';
|
||||
import api, { e } from 'vj/utils/api';
|
||||
import loadReactRedux from 'vj/utils/loadReactRedux';
|
||||
import parseQueryString from 'vj/utils/parseQueryString';
|
||||
|
||||
@@ -79,16 +79,16 @@ const page = new NamedPage('home_messages', () => {
|
||||
*/
|
||||
async function loadSendTarget() {
|
||||
const queryString = parseQueryString();
|
||||
if (!queryString.target) {
|
||||
return;
|
||||
}
|
||||
const user = await request.get('/user/search', {
|
||||
q: queryString.target,
|
||||
exact_match: true,
|
||||
});
|
||||
if (!user || user.length === 0) {
|
||||
return;
|
||||
}
|
||||
if (!queryString.target) return;
|
||||
const user = await api(e`
|
||||
users(search: ${queryString.target}, exact: true) {
|
||||
_id
|
||||
uname
|
||||
avatarUrl
|
||||
mail
|
||||
}
|
||||
`, ['data', 'users']);
|
||||
if (!user?.length) return;
|
||||
createDialog(user[0]);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user