diff --git a/e2e/clients.spec.ts b/e2e/clients.spec.ts index 1e073bab..843095cc 100644 --- a/e2e/clients.spec.ts +++ b/e2e/clients.spec.ts @@ -190,16 +190,12 @@ test('test that sorting clients by project count works', async ({ page, ctx }) = await projectsHeader.click(); await expect(projectsHeader.locator('svg')).toBeVisible(); let names = await getTableRowNames(table); - expect(names.indexOf('ManyProjects Client')).toBeLessThan( - names.indexOf('NoProjects Client') - ); + expect(names.indexOf('ManyProjects Client')).toBeLessThan(names.indexOf('NoProjects Client')); // Second click toggles to asc (least projects first) await projectsHeader.click(); names = await getTableRowNames(table); - expect(names.indexOf('NoProjects Client')).toBeLessThan( - names.indexOf('ManyProjects Client') - ); + expect(names.indexOf('NoProjects Client')).toBeLessThan(names.indexOf('ManyProjects Client')); }); test('test that client sort state persists after page reload', async ({ page }) => { diff --git a/resources/js/Components/Common/Client/ClientTable.vue b/resources/js/Components/Common/Client/ClientTable.vue index dc5e14c9..38b35b7f 100644 --- a/resources/js/Components/Common/Client/ClientTable.vue +++ b/resources/js/Components/Common/Client/ClientTable.vue @@ -67,7 +67,9 @@ const columns = computed(() => [ ]); const descFirstColumns = new Set( - columns.value.filter((c) => 'sortDescFirst' in c && c.sortDescFirst).map((c) => c.id as SortColumn) + columns.value + .filter((c) => 'sortDescFirst' in c && c.sortDescFirst) + .map((c) => c.id as SortColumn) ); function handleSort(column: SortColumn) { diff --git a/resources/js/utils/useProjectMembers.ts b/resources/js/utils/useProjectMembers.ts index 13104e3d..2c1c88cd 100644 --- a/resources/js/utils/useProjectMembers.ts +++ b/resources/js/utils/useProjectMembers.ts @@ -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], + }); } } diff --git a/resources/js/utils/useProjectMembersQuery.ts b/resources/js/utils/useProjectMembersQuery.ts index 56b99793..34872daa 100644 --- a/resources/js/utils/useProjectMembersQuery.ts +++ b/resources/js/utils/useProjectMembersQuery.ts @@ -32,7 +32,9 @@ export function useProjectMembersQuery(projectId: Ref | string) { const projectMembers = computed(() => query.data.value?.data ?? []); const invalidateProjectMembers = () => { - queryClient.invalidateQueries({ queryKey: ['projectMembers', projectIdValue.value] }); + queryClient.invalidateQueries({ + queryKey: ['projectMembers', getCurrentOrganizationId(), projectIdValue.value], + }); }; return {