improvement: org user groups tables search fixed and col sort added and group add users pagination fixed and search improved to include first and last name

This commit is contained in:
Scott Wilson
2024-10-18 13:20:17 -07:00
parent b22a93a175
commit d677654311
18 changed files with 247 additions and 81 deletions
+8 -7
View File
@@ -10,13 +10,13 @@ export const groupKeys = {
slug,
offset,
limit,
username
search
}: {
slug: string;
offset: number;
limit: number;
username: string;
}) => [...groupKeys.forGroupUserMemberships(slug), { offset, limit, username }] as const
search: string;
}) => [...groupKeys.forGroupUserMemberships(slug), { offset, limit, search }] as const
};
type TUser = {
@@ -33,27 +33,28 @@ export const useListGroupUsers = ({
groupSlug,
offset = 0,
limit = 10,
username
search
}: {
id: string;
groupSlug: string;
offset: number;
limit: number;
username: string;
search: string;
}) => {
return useQuery({
queryKey: groupKeys.specificGroupUserMemberships({
slug: groupSlug,
offset,
limit,
username
search
}),
enabled: Boolean(groupSlug),
keepPreviousData: true,
queryFn: async () => {
const params = new URLSearchParams({
offset: String(offset),
limit: String(limit),
username
search
});
const { data } = await apiRequest.get<{ users: TUser[]; totalCount: number }>(