ra-data-processmaker3
v0.10.0
Published
React Admin ProcessMaker3 DataProvider
Downloads
54
Maintainers
Readme
ra-data-processmaker3
React Admin ProcessMaker3 DataProvider
Installation
npm i --save query-string ra-data-processmaker3
Usage
// in src/App.tsx
import React from "react";
import { Admin, Resource } from "react-admin";
import pmProvider from "ra-data-processmaker3";
import { PostList } from "./posts";
const App = () => (
<Admin dataProvider={pmProvider("http://path.to.my.api/")}>
<Resource name="posts" list={PostList} />
</Admin>
);
export default App;
Customizing Http Client
// in src/App.tsx
import { fetchUtils, Admin, Resource } from "react-admin";
import pmProvider from "ra-data-processmaker3";
const httpClient = (url, options = {}) => {
if (!options.headers) {
options.headers = new Headers({ Accept: "application/json" });
}
// add your own headers here
options.headers.set("X-Custom-Header", "foobar");
return fetchUtils.fetchJson(url, options);
};
const provider = pmProvider("http://path.to.my.api/", httpClient);
Contributors
License
This project is licensed under the MIT license.
Copyright (c) KoLiBer ([email protected])