angular2-jsonapi
angular2-jsonapi copied to clipboard
I have some questions about the extractRecordData method
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.