Skip to content

Version 0.6.8

Compare
Choose a tag to compare
@lexich lexich released this 12 Nov 06:54
· 249 commits to master since this release

Validation is working in request method #20

// rest.js
import reduxApi from "redux-api";
export default reduxApi({
  test: {
    url: "/api/test"
    options: {
      method: "post",
      headers: {
        "Accept": "application/json",
        "Content-type": "application/json"
      }
    },
    virtual: true,
    validation(data, cb) {
      const err = !data ? "Invalid data" : null;
      cb(err, data);
    }
  }
});

.....
import {actions} from "./rest"
actions.test.request().then(...)

art-hrocpb8