Skip to content

saveRecord return model even on error response #133

@Jerga99

Description

@Jerga99

There is something with implementation of saveRecord after we updated library, our app is not working correctly anymore. When we got error response, service returns always Model.

return httpCall
.map((res) => res.status === 201 ? this.extractRecordData(res, modelType, model) : model)
.catch((error) => {
console.error(error);
return Observable.of(model);
})
.map((res) => this.resetMetadataAttributes(res, attributesMetadata, modelType))
.map((res) => this.updateRelationships(res, relationships))
.catch((res) => this.handleError(res));
}

First catch is not necessary and should be removed. Second catch is never called... I dont know this part of code seems little messy for me. Can I make PR to fix this issue ? (Works correctly for us after delete of first catch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions