From 3e6359f06675cc10ea58ceef34c13b22fa1550b9 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 19 Mar 2025 11:41:41 -0600 Subject: [PATCH] update evals --- web/src/api/buster_rest/users/queryRequests.ts | 7 +++---- web/src/api/buster_rest/users/requests.ts | 13 +++++++------ web/src/api/query_keys/users.ts | 4 ++-- web/src/api/request_interfaces/user/interfaces.ts | 6 ------ 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/web/src/api/buster_rest/users/queryRequests.ts b/web/src/api/buster_rest/users/queryRequests.ts index 2d4e2bdc9..20e1401e2 100644 --- a/web/src/api/buster_rest/users/queryRequests.ts +++ b/web/src/api/buster_rest/users/queryRequests.ts @@ -17,9 +17,8 @@ import { import { useMemoizedFn } from '@/hooks'; import { QueryClient, useQueryClient } from '@tanstack/react-query'; import { queryKeys } from '@/api/query_keys'; -import type { UserRequestUserListPayload } from '@/api/request_interfaces/user/interfaces'; import { useBusterNotifications } from '@/context/BusterNotifications'; -import { useCreateOrganization } from '../organizations/queryRequests'; +import { useCreateOrganization } from '../organizations'; export const useGetMyUserInfo = () => { return useQuery({ @@ -144,7 +143,7 @@ export const useUpdateUserFavorites = () => { }); }; -export const useGetUserList = (params: UserRequestUserListPayload) => { +export const useGetUserList = (params: Parameters[0]) => { const queryFn = useMemoizedFn(() => getUserList(params)); return useQuery({ @@ -154,7 +153,7 @@ export const useGetUserList = (params: UserRequestUserListPayload) => { }; export const prefetchGetUserList = async ( - params: UserRequestUserListPayload, + params: Parameters[0], queryClientProp?: QueryClient ) => { const queryClient = queryClientProp || new QueryClient(); diff --git a/web/src/api/buster_rest/users/requests.ts b/web/src/api/buster_rest/users/requests.ts index f6f186185..be77c612b 100644 --- a/web/src/api/buster_rest/users/requests.ts +++ b/web/src/api/buster_rest/users/requests.ts @@ -5,10 +5,7 @@ import type { BusterUserFavorite, BusterUserListItem } from '@/api/asset_interfaces/users'; -import type { - UserRequestUserListPayload, - UsersFavoritePostPayload -} from '@/api/request_interfaces/user/interfaces'; +import type { UsersFavoritePostPayload } from '@/api/request_interfaces/user/interfaces'; import { mainApi } from '../instances'; import { serverFetch } from '../../createServerInstance'; @@ -136,12 +133,16 @@ export const updateUserFavorites_server = async (payload: string[]) => { //USER LIST -export const getUserList = async (payload: UserRequestUserListPayload) => { +export const getUserList = async (payload: { + team_id: string; + page?: number; + page_size?: number; +}) => { return mainApi .get(`/users`, { params: payload }) .then((response) => response.data); }; -export const getUserList_server = async (payload: UserRequestUserListPayload) => { +export const getUserList_server = async (payload: Parameters[0]) => { return serverFetch(`/users`, { params: payload }); }; diff --git a/web/src/api/query_keys/users.ts b/web/src/api/query_keys/users.ts index b4e3d78de..809715018 100644 --- a/web/src/api/query_keys/users.ts +++ b/web/src/api/query_keys/users.ts @@ -10,7 +10,7 @@ import type { OrganizationUser, BusterUserListItem } from '@/api/asset_interfaces/users'; -import type { UserRequestUserListPayload } from '@/api/request_interfaces/user/interfaces'; +import { getUserList } from '../buster_rest/users/requests'; const favoritesGetList = queryOptions({ queryKey: ['users', 'favorites', 'list'] as const, @@ -54,7 +54,7 @@ const userGetUserDatasetGroups = (userId: string) => queryKey: ['users', userId, 'datasetGroups'] as const }); -const userGetUserList = (params: UserRequestUserListPayload) => +const userGetUserList = (params: Parameters[0]) => queryOptions({ queryKey: ['users', 'list', params] as const }); diff --git a/web/src/api/request_interfaces/user/interfaces.ts b/web/src/api/request_interfaces/user/interfaces.ts index dcec79e30..110a0ed8b 100644 --- a/web/src/api/request_interfaces/user/interfaces.ts +++ b/web/src/api/request_interfaces/user/interfaces.ts @@ -6,9 +6,3 @@ export type UsersFavoritePostPayload = { index?: number; name: string; //just used for the UI for optimistic update }; - -export interface UserRequestUserListPayload { - team_id: string; - page?: number; - page_size?: number; -}