This commit is contained in:
elforjani3
2020-10-17 15:25:57 +02:00
59 changed files with 2538 additions and 1301 deletions

View File

@@ -0,0 +1,34 @@
import React from 'react';
import PropTypes from 'prop-types';
function ErrorBoundary({
error,
errorInfo,
children
}) {
if (errorInfo) {
return (
<div>
<h2>Something went wrong.</h2>
<details style={{ whiteSpace: 'pre-wrap' }}>
{error && error.toString()}
<br />
{errorInfo.componentStack}
</details>
</div>
);
}
return children;
}
ErrorBoundary.defaultProps = {
children: null,
};
ErrorBoundary.propTypes = {
children: PropTypes.node,
};
export default ErrorBoundary;

View File

@@ -27,7 +27,7 @@ export const fetchView = ({ id }) => {
export const fetchResourceViews = ({ resourceSlug }) => {
return (dispatch) => new Promise((resolve, reject) => {
ApiService.get('views', { params: { resource_name: resourceSlug } })
ApiService.get(`views/resource/${resourceSlug}`)
.then((response) => {
dispatch({
type: t.RESOURCE_VIEWS_SET,