Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forbidden error #8

Open
mnlbox opened this issue Dec 25, 2018 · 0 comments
Open

Forbidden error #8

mnlbox opened this issue Dec 25, 2018 · 0 comments

Comments

@mnlbox
Copy link

mnlbox commented Dec 25, 2018

Hi @Pritoj,
I try to use this awesome plugin but it's return Forbiden error. It's my code:

/// IMPORTANT to import like this.
import Strapi from 'strapi-sdk-javascript/build/main';
import strapiDataProvider from 'ra-dp-strapi';
import React from 'react';
import { render } from 'react-dom';
import { Admin, Resource } from 'react-admin';
import { TestList } from './tests/list';

const apiUrl = 'http://localhost:1337';
const strapi = new Strapi(apiUrl);


class App extends React.Component {
  render() {
    return (
        <Admin dataProvider={strapiDataProvider(strapi)}>
            <Resource name="tests" list={TestList}/>
        </Admin>
    );
  }
}

export default App;
// in list.js
import React from 'react';
import { List, Datagrid, Edit, Create, SimpleForm, DateField, TextField, EditButton, DisabledInput, TextInput, LongTextInput, DateInput } from 'react-admin';
import BookIcon from '@material-ui/icons/Book';
export const PostIcon = BookIcon;

export const TestList = (props) => (
    <List {...props}>
        <Datagrid>
            <TextField source="id" />
            <TextField source="title" />
            <DateField source="description" />
        </Datagrid>
    </List>
);

Can you guide me to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant