Fix init request

Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2020-04-07 14:55:26 +02:00
parent 9532212e86
commit c5441f1d61
2 changed files with 5 additions and 9 deletions

View File

@ -42,7 +42,9 @@ function App(props) {
try {
const requestURL = '/users-permissions/init';
const { hasAdmin } = await request(requestURL, { method: 'GET' });
const { hasAdmin } = await request(requestURL, { method: 'GET' }, false, false, {
noAuth: true,
});
const { data } = await request('/admin/init', { method: 'GET' });
const { uuid } = data;
@ -86,9 +88,7 @@ function App(props) {
<Switch>
<Route
path="/auth/:authType"
render={routerProps => (
<AuthPage {...routerProps} hasAdminUser={state.hasAdmin} />
)}
render={routerProps => <AuthPage {...routerProps} hasAdminUser={state.hasAdmin} />}
exact
/>
<PrivateRoute path="/" component={Admin} />
@ -108,10 +108,7 @@ export function mapDispatchToProps(dispatch) {
return bindActionCreators({ getDataSucceeded }, dispatch);
}
const withConnect = connect(
null,
mapDispatchToProps
);
const withConnect = connect(null, mapDispatchToProps);
export default compose(withConnect)(App);
export { App };

View File

@ -135,7 +135,6 @@ const EditForm = forwardRef(
};
const handleClick = async () => {
console.log('click');
const cropResult = await getCroppedResult();
setCropResult(cropResult);