angular2-jsonapi icon indicating copy to clipboard operation
angular2-jsonapi copied to clipboard

I have some questions about the extractRecordData method

Open Caxvalencia opened this issue 7 years ago • 0 comments

In my response I getting thing like:

{
  "data": {
    "type": "users",
      "attributes": {
      "is-enabled": true,
      "username": "[email protected]",
      ...
   }
}

However, this line overwrites the object, with the attributes that come from the response:

https://github.com/ghidoz/angular2-jsonapi/blob/345c45b64f370602a62f540c57b9ccd8e482e195/src/services/json-api-datastore.service.ts#L306

so this makes my object have a property called is-enabled.

Is it necessary to validate the model before?, and why not deserialize it once with deserializeModel method? https://github.com/ghidoz/angular2-jsonapi/blob/345c45b64f370602a62f540c57b9ccd8e482e195/src/services/json-api-datastore.service.ts#L309

Thanks for your aswers :D.

Caxvalencia avatar Apr 12 '18 13:04 Caxvalencia