mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core&ui: drop graphql apis
This commit is contained in:
1 parent
0f7961d675
commit
6e16d03f67
52 files changed
+485
-583
No files matched your search
@@ -5,7 +5,7 @@ import VjNotification from 'vj/components/notification';
|
||||
import selectUser from 'vj/components/selectUser';
|
||||
import { ctx, Service } from 'vj/context';
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
import { api, gql, loadReactRedux } from 'vj/utils';
|
||||
import { api, loadReactRedux } from 'vj/utils';
|
||||
|
||||
class MessagePadService extends Service {
|
||||
WebSocket: typeof import('../components/socket').default;
|
||||
@@ -91,14 +91,10 @@ const page = new NamedPage('home_messages', () => {
|
||||
async function loadSendTarget() {
|
||||
const target = new URL(window.location.href).searchParams.get('target');
|
||||
if (!target) return;
|
||||
const user = await api(gql`
|
||||
users(search: ${target}, exact: true) {
|
||||
_id
|
||||
uname
|
||||
avatarUrl
|
||||
mail
|
||||
}
|
||||
`, ['data', 'users']);
|
||||
const user = await api(
|
||||
'users', { search: target, exact: true },
|
||||
['_id', 'uname', 'avatarUrl', 'mail'],
|
||||
);
|
||||
if (!user?.length) return;
|
||||
createDialog(user[0]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user