Skip to content

Releases: CodeYellowBV/mobx-spine

v0.18.1

20 Dec 14:41
Compare
Choose a tag to compare
  • Add automatic CSRF failure handling (if CSRF token is invalid, it will re-fetch token automatically)

v0.18.0

19 Dec 14:44
Compare
Choose a tag to compare
  • Changed model.isChanged() method to model.hasUserChanges. This is a computed value and allows React to re-render automatically if this value changes.

v0.16.1

24 Jul 07:58
Compare
Choose a tag to compare
  • model.fetch() and store.fetch() can pass through options to the backend API class now. E.g. model.fetch({ skipRequestError: true }).

v0.16.0

14 Jul 11:27
Compare
Choose a tag to compare
  • Add support for nested backend validation errors; this means that validation errors from a deeply nested model will be properly set on that model, so you can easily show it in the frontend.
  • Add model.setInput(name, value), a shorthand for setting user input. This will also clear backend validation errors for this field.

v0.15.2

22 Jun 15:14
Compare
Choose a tag to compare
  • Fix regression introduced in 0.14.0 when response of multi-PUT is empty.

v0.15.0

21 Jun 14:22
Compare
Choose a tag to compare
  • Fix fetching a store when a relation should be converted to snake_case for the backend.
  • Breaking change: the model methods toBackendAttrKey and fromBackendAttrKey are static methods now, so if you want to override this you need to do this:

from:

    toBackendAttrKey(attrKey) {
        return camelToSnake(attrKey);
    }

to:

    static toBackendAttrKey(attrKey) {
        return camelToSnake(attrKey);
    }

v0.14.0

20 Jun 11:32
Compare
Choose a tag to compare
  • After a successful multi-PUT on a new model, the new id was not saved in the model.
  • If backendResourceName is set on a model or store, it will try to auto generate the url based on that.

Example:

class Animal extends Model {
  static backendResourceName = 'animal';
}
const animal = new Animal({ id: 1 });
animal.fetch();
// Will do a request to GET /animal/1/

v0.13.3

16 Jun 11:53
Compare
Choose a tag to compare
  • Show actual value when value supplied to parse() is invalid.
  • De-duplicate relations when saving to backend with .toBackendAll(). This was only an issue if you did a little bit of mobx-spine hackery.

v0.13.2

16 Jun 11:51
Compare
Choose a tag to compare
0.13.2

v0.13.1

29 May 15:32
Compare
Choose a tag to compare
  • Many fixes to deeply nesting relations.
  • Make it easy to disable or change the way how mobx-spine does snake_case <-> camelCase converting when parsing from/to backend.
  • Throw error when you define an attribute on a model that is already in use by mobx-spine. Example: @observable url.