From 97fd36e924c771228416fadedd543eaf7b92d0a2 Mon Sep 17 00:00:00 2001 From: Mikita Siadykh Date: Fri, 8 Sep 2023 13:06:36 +0400 Subject: [PATCH] UISACQCOMP-131 do not re-create default value in useUserBatch (#716) --- lib/hooks/useUsersBatch/useUsersBatch.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/hooks/useUsersBatch/useUsersBatch.js b/lib/hooks/useUsersBatch/useUsersBatch.js index c441b9ac..8eb4bb7a 100644 --- a/lib/hooks/useUsersBatch/useUsersBatch.js +++ b/lib/hooks/useUsersBatch/useUsersBatch.js @@ -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' }); @@ -29,7 +31,7 @@ export const useUsersBatch = (userIds) => { ); return { - users: data || [], + users: data || DEFAULT_USERS_BY_IDS, isLoading, }; };