update()

in src/models/basic/remote-post.js [102:117]


  update(value) {
    this._response = value;
    if (value.status && value.status === 401) {
      this.error = (value.data ? value.data.message : undefined) || value.message;
      this.failed = true;
    } else if (value.status && (value.status === 200 || value.status === 201)) {
      this._value = RemotePost.postprocess(value);
      this._loaded = true;
      this.error = undefined;
      this.failed = false;
    } else {
      this.error = (value.data ? value.data.message : undefined) || value.message;
      this.failed = true;
      this._loaded = false;
    }
  }