Skip to content

Commit

Permalink
UISACQCOMP-131 do not re-create default value in useUserBatch (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaSedyx authored Sep 8, 2023
1 parent 3a3c0f2 commit 97fd36e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/hooks/useUsersBatch/useUsersBatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
import { USERS_API } from '../../constants';
import { batchRequest } from '../../utils';

const DEFAULT_USERS_BY_IDS = [];

export const useUsersBatch = (userIds) => {
const ky = useOkapiKy();
const [namespace] = useNamespace({ key: 'users' });
Expand All @@ -29,7 +31,7 @@ export const useUsersBatch = (userIds) => {
);

return {
users: data || [],
users: data || DEFAULT_USERS_BY_IDS,
isLoading,
};
};

0 comments on commit 97fd36e

Please sign in to comment.