mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-15 03:32:15 +01:00
fix project member query invalidations after update, query key change regression
This commit is contained in:
@@ -26,7 +26,9 @@ export const useProjectMembersStore = defineStore('project-members', () => {
|
||||
'Project member added successfully',
|
||||
'Failed to add project member'
|
||||
);
|
||||
queryClient.invalidateQueries({ queryKey: ['projectMembers', projectId] });
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ['projectMembers', organization, projectId],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +51,7 @@ export const useProjectMembersStore = defineStore('project-members', () => {
|
||||
);
|
||||
if (response?.data?.project_id) {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ['projectMembers', response.data.project_id],
|
||||
queryKey: ['projectMembers', organization, response.data.project_id],
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -69,7 +71,9 @@ export const useProjectMembersStore = defineStore('project-members', () => {
|
||||
'Project member removed successfully',
|
||||
'Failed to remove project member'
|
||||
);
|
||||
queryClient.invalidateQueries({ queryKey: ['projectMembers', projectId] });
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ['projectMembers', organizationId, projectId],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@ export function useProjectMembersQuery(projectId: Ref<string | null> | string) {
|
||||
const projectMembers = computed<ProjectMember[]>(() => query.data.value?.data ?? []);
|
||||
|
||||
const invalidateProjectMembers = () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['projectMembers', projectIdValue.value] });
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ['projectMembers', getCurrentOrganizationId(), projectIdValue.value],
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user