refactor: Introduce granular query types with specific policies for improved caching and data freshness.

This commit is contained in:
pa
2026-03-11 14:37:43 +09:00
parent 14d73b1532
commit a75c4b89f8
23 changed files with 221 additions and 39 deletions
+2 -2
View File
@@ -363,7 +363,7 @@ export const useGalleryStore = defineStore('Gallery', () => {
const print = args.json;
const createdAt = getPrintLocalDate(print);
try {
const owner = await queryRequest.fetch('user', {
const owner = await queryRequest.fetch('user.dialog', {
userId: print.ownerId
});
console.log(
@@ -558,7 +558,7 @@ export const useGalleryStore = defineStore('Gallery', () => {
return;
}
const userArgs = await queryRequest.fetch('user', {
const userArgs = await queryRequest.fetch('user.dialog', {
userId: args.json.holderId
});
const displayName = userArgs.json?.displayName ?? '';
+1 -1
View File
@@ -274,7 +274,7 @@ export const useGroupStore = defineStore('Group', () => {
D.groupRef = {};
D.auditLogTypes = [];
queryRequest.fetch('group', { groupId }).then((args) => {
queryRequest.fetch('group.dialog', { groupId }).then((args) => {
D.groupRef = args.ref;
if (hasGroupPermission(D.groupRef, 'group-audit-view')) {
groupRequest.getGroupAuditLogTypes({ groupId }).then((args) => {
+6 -6
View File
@@ -245,7 +245,7 @@ export const useInstanceStore = defineStore('Instance', () => {
emptyDefault: { id: '', displayName: '' },
idAlias: 'userId',
nameKey: 'displayName',
fetchFn: (id) => queryRequest.fetch('user', { userId: id })
fetchFn: (id) => queryRequest.fetch('user.dialog', { userId: id })
});
}
@@ -258,7 +258,7 @@ export const useInstanceStore = defineStore('Instance', () => {
emptyDefault: { id: '', name: '' },
idAlias: 'worldId',
nameKey: 'name',
fetchFn: (id) => queryRequest.fetch('world', { worldId: id })
fetchFn: (id) => queryRequest.fetch('world.location', { worldId: id })
});
}
@@ -271,7 +271,7 @@ export const useInstanceStore = defineStore('Instance', () => {
emptyDefault: { id: '', name: '' },
idAlias: 'groupId',
nameKey: 'name',
fetchFn: (id) => queryRequest.fetch('group', { groupId: id })
fetchFn: (id) => queryRequest.fetch('group.dialog', { groupId: id })
});
}
@@ -340,7 +340,7 @@ export const useInstanceStore = defineStore('Instance', () => {
!worldStore.cachedWorlds.get(location.worldId)?.name
) {
queryRequest
.fetch('world', { worldId: location.worldId })
.fetch('world.dialog', { worldId: location.worldId })
.then((args) => {
uiStore.setDialogCrumbLabel(
'previous-instances-info',
@@ -467,7 +467,7 @@ export const useInstanceStore = defineStore('Instance', () => {
});
} else {
queryRequest
.fetch('world', {
.fetch('world.location', {
worldId: currentInstanceLocation.value.worldId
})
.then((args) => {
@@ -537,7 +537,7 @@ export const useInstanceStore = defineStore('Instance', () => {
ref.$location = parseLocation(ref.location);
if (ref.world?.id) {
queryRequest
.fetch('world', {
.fetch('world.location', {
worldId: ref.world.id
})
.then((args) => {
+1 -1
View File
@@ -221,7 +221,7 @@ export const useDiscordPresenceSettingsStore = defineStore(
groupAccessName: ''
};
try {
const args = await queryRequest.fetch('world', {
const args = await queryRequest.fetch('world.location', {
worldId: L.worldId
});
state.lastLocationDetails.worldName = args.ref.name;
+1 -1
View File
@@ -644,7 +644,7 @@ export const useVrcxStore = defineStore('Vrcx', () => {
toast.error('Invalid local favorite world command');
break;
}
queryRequest.fetch('world', { worldId: id }).then(() => {
queryRequest.fetch('world.location', { worldId: id }).then(() => {
searchStore.directAccessWorld(id);
addLocalWorldFavorite(id, group);
});