rest - Handling inconsistent data between front-end and back-end -


i have been wondering quite while in following situation:

  1. user loads data on front-end , starts editing it
  2. second user same , and sends update stored in db end
  3. 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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -