mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
refactor: Introduce granular query types with specific policies for improved caching and data freshness.
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
if (props.hint) {
|
||||
username.value = props.hint;
|
||||
} else if (props.userid) {
|
||||
const args = await queryRequest.fetch('user', { userId: props.userid });
|
||||
const args = await queryRequest.fetch('user.dialog', { userId: props.userid });
|
||||
if (args?.json?.displayName) {
|
||||
username.value = args.json.displayName;
|
||||
}
|
||||
|
||||
@@ -701,7 +701,7 @@
|
||||
selectedImageUrl: post.imageUrl
|
||||
};
|
||||
}
|
||||
queryRequest.fetch('group', { groupId }).then((args) => {
|
||||
queryRequest.fetch('group.dialog', { groupId }).then((args) => {
|
||||
D.groupRef = args.ref;
|
||||
});
|
||||
D.visible = true;
|
||||
|
||||
@@ -362,7 +362,7 @@ describe('useGroupModerationData', () => {
|
||||
const { addGroupMemberToSelection } = useGroupModerationData(deps);
|
||||
await addGroupMemberToSelection('usr_1');
|
||||
|
||||
expect(queryRequest.fetch).toHaveBeenCalledWith('user', { userId: 'usr_1' });
|
||||
expect(queryRequest.fetch).toHaveBeenCalledWith('user.dialog', { userId: 'usr_1' });
|
||||
expect(deps.selection.setSelectedUsers).toHaveBeenCalledWith('usr_1', expect.objectContaining({
|
||||
userId: 'usr_1',
|
||||
displayName: 'Alice'
|
||||
|
||||
@@ -492,7 +492,7 @@ export function useGroupModerationData(deps) {
|
||||
selection.setSelectedUsers(member.userId, member);
|
||||
return;
|
||||
}
|
||||
const userArgs = await queryRequest.fetch('user', { userId });
|
||||
const userArgs = await queryRequest.fetch('user.dialog', { userId });
|
||||
member.userId = userArgs.json.id;
|
||||
member.user = userArgs.json;
|
||||
member.displayName = userArgs.json.displayName;
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
}
|
||||
|
||||
if (D.userId) {
|
||||
queryRequest.fetch('user', { userId: D.userId }).then((args) => {
|
||||
queryRequest.fetch('user.dialog', { userId: D.userId }).then((args) => {
|
||||
D.userObject = args.ref;
|
||||
D.userIds = [D.userId];
|
||||
});
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
}
|
||||
|
||||
if (D.userId) {
|
||||
queryRequest.fetch('user', { userId: D.userId }).then((args) => {
|
||||
queryRequest.fetch('user.dialog', { userId: D.userId }).then((args) => {
|
||||
D.userObject = args.ref;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
displayName.value = '';
|
||||
queryRequest.fetch('user', { userId: sendBoopDialog.value.userId }).then((user) => {
|
||||
queryRequest.fetch('user.dialog', { userId: sendBoopDialog.value.userId }).then((user) => {
|
||||
displayName.value = user.ref.displayName;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user