Skip to content

Commit 5db446e

Browse files
AntoLClunika
authored andcommitted
🏷️(frontend) adapt type for user search
The response from the user request is now an array of users, we don't paginate anymore. We adapt the types to reflect this.
1 parent 34dfb3f commit 5db446e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/frontend/apps/impress/src/features/docs/doc-share/api/useUsers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { UseQueryOptions, useQuery } from '@tanstack/react-query';
22

3-
import { APIError, APIList, errorCauses, fetchAPI } from '@/api';
3+
import { APIError, errorCauses, fetchAPI } from '@/api';
44
import { Doc } from '@/docs/doc-management';
55
import { User } from '@/features/auth';
66

@@ -9,7 +9,7 @@ export type UsersParams = {
99
docId: Doc['id'];
1010
};
1111

12-
type UsersResponse = APIList<User>;
12+
type UsersResponse = User[];
1313

1414
export const getUsers = async ({
1515
query,

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const DocShareModal = ({ doc, onClose }: Props) => {
125125
}, [invitationQuery, t]);
126126

127127
const searchUserData: QuickSearchData<User> = useMemo(() => {
128-
const users = searchUsersQuery.data?.results || [];
128+
const users = searchUsersQuery.data || [];
129129
const isEmail = isValidEmail(userQuery);
130130
const newUser: User = {
131131
id: userQuery,

0 commit comments

Comments
 (0)