From 1ba90858845d01defda0dcddf7987704523eb6ec Mon Sep 17 00:00:00 2001 From: Yury Saukou Date: Tue, 14 Nov 2023 13:49:28 +0400 Subject: [PATCH] UIORGS-390 use translated categories --- src/common/hooks/useCategories/useCategories.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/hooks/useCategories/useCategories.js b/src/common/hooks/useCategories/useCategories.js index bea47113..d21faa11 100644 --- a/src/common/hooks/useCategories/useCategories.js +++ b/src/common/hooks/useCategories/useCategories.js @@ -7,6 +7,7 @@ import { import { LIMIT_MAX } from '@folio/stripes-acq-components'; import { CATEGORIES_API } from '../../constants'; +import { useTranslatedCategories } from '../useTranslatedCategories'; const DEFAULT_DATA = []; @@ -28,8 +29,10 @@ export const useCategories = () => { () => ky.get(CATEGORIES_API, { searchParams }).json(), ); + const [translatedCategories] = useTranslatedCategories(data?.categories); + return ({ - categories: data?.categories || DEFAULT_DATA, + categories: translatedCategories || DEFAULT_DATA, totalRecords: data?.totalRecords, isFetching, isLoading,