rest - Handling inconsistent data between front-end and back-end -
i have been wondering quite while in following situation:
- user loads data on front-end , starts editing it
- second user same , and sends update stored in db end
- the first user sending updated data has been changed or not exist.
what in such situations check in validation procedure on end, , if inconsistent return 409 http status message stating data has been changed(updated/deleted). on front-end notify user there have been changes applied data, , ask wants overwrite changes (or create new record if old 1 has been deleted).
so question is, there better way or on right path here?
if insist on using html statuses idea pretty good. not bother send different http statuses, rather use 200 , send in lines of {success: false, message: "reason not succeeding"}
Comments
Post a Comment