Преглед изворни кода

refs 79379 79549

Implemented error message handling in pagelist.
Takayuki Tamura пре 4 година
родитељ
комит
26df38bbb0
1 измењених фајлова са 6 додато и 7 уклоњено
  1. 6 7
      packages/app/src/components/PageList.jsx

+ 6 - 7
packages/app/src/components/PageList.jsx

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