Skip to content

Commit

Permalink
UIORGS-390 use translated categories
Browse files Browse the repository at this point in the history
  • Loading branch information
usavkov-epam committed Nov 14, 2023
1 parent fb4b218 commit 1ba9085
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/common/hooks/useCategories/useCategories.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand All @@ -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,
Expand Down

0 comments on commit 1ba9085

Please sign in to comment.