|
|
@@ -1,4 +1,4 @@
|
|
|
-import React, { useEffect, useCallback, useState } from 'react';
|
|
|
+import React, { useState } from 'react';
|
|
|
import PropTypes from 'prop-types';
|
|
|
import { withTranslation } from 'react-i18next';
|
|
|
|
|
|
@@ -8,7 +8,6 @@ import { withUnstatedContainers } from './UnstatedUtils';
|
|
|
import AppContainer from '~/client/services/AppContainer';
|
|
|
import PageContainer from '~/client/services/PageContainer';
|
|
|
|
|
|
-import { toastError } from '~/client/util/apiNotification';
|
|
|
import { useSWRxPageList } from '~/stores/page';
|
|
|
|
|
|
import PaginationWrapper from './PaginationWrapper';
|
|
|
@@ -20,18 +19,19 @@ const PageList = (props) => {
|
|
|
|
|
|
const [activePage, setActivePage] = useState(1);
|
|
|
|
|
|
- const { data: pagesListData, error } = useSWRxPageList(path, activePage);
|
|
|
+ const { data: pagesListData, error: errors } = useSWRxPageList(path, activePage);
|
|
|
|
|
|
function setPageNumber(selectedPageNumber) {
|
|
|
setActivePage(selectedPageNumber);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- // TODO: To be implemented in #79549
|
|
|
- if (error != null) {
|
|
|
- // toastError(error, 'Error occurred in PageList');
|
|
|
- // eslint-disable-next-line no-console
|
|
|
- console.log(error, 'Error occurred in PageList');
|
|
|
+ if (errors != null) {
|
|
|
+ return (
|
|
|
+ <div className="my-5">
|
|
|
+ {/* eslint-disable-next-line react/no-array-index-key */}
|
|
|
+ {errors.map((error, index) => <div key={index} className="text-danger">{error.message}</div>)}
|
|
|
+ </div>
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
if (pagesListData == null) {
|