Jelajahi Sumber

refactor ApiErrorMessage

itizawa 5 tahun lalu
induk
melakukan
93a1baef77

+ 4 - 4
src/client/js/components/PageManagement/ApiErrorMessage.jsx

@@ -6,18 +6,18 @@ import toArrayIfNot from '../../../../lib/util/toArrayIfNot';
 
 
 const ApiErrorMessage = (props) => {
 const ApiErrorMessage = (props) => {
   const {
   const {
-    t, errors, targetPath,
+    t, errForDisplay, targetPath,
   } = props;
   } = props;
 
 
   function reload() {
   function reload() {
     window.location.reload();
     window.location.reload();
   }
   }
 
 
-  if (errors == null) {
+  if (errForDisplay == null) {
     return null;
     return null;
   }
   }
 
 
-  const errArray = toArrayIfNot(errors);
+  const errArray = toArrayIfNot(errForDisplay);
 
 
   function renderMessage(err) {
   function renderMessage(err) {
 
 
@@ -85,7 +85,7 @@ const ApiErrorMessage = (props) => {
 ApiErrorMessage.propTypes = {
 ApiErrorMessage.propTypes = {
   t:            PropTypes.func.isRequired, //  i18next
   t:            PropTypes.func.isRequired, //  i18next
 
 
-  errors:       PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
+  errForDisplay:       PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
   targetPath:   PropTypes.string,
   targetPath:   PropTypes.string,
 };
 };