Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • Thank you for the insight! One clarification: if I don't need to "go further" is it still valuable to send back the entire object as the response? Otherwise, I would need to maintain 2 locations where I create the object; backend and frontend. Commented Mar 9, 2019 at 0:22
  • I don't think so or I can't imagine your case. Assume that you create a thing and you don't need to go further. So, you can turn your things list page and let user do what he/she wants. If he/she want to see object details, then you can request to the server to get object details. Why are you storing object on front-end if you don't need to use it(no need to going further) Commented Mar 9, 2019 at 0:32
  • Ah! "don't need to go further" as in I don't necessarily need the information from the response. This may be bad practice on my part, but I'm generating Id on the front end, and sending that to the backend, so I wouldn't need that info from the response. The thing is then shown to the user, so I would need to store it on the front-end as well. Essentially, this case I would need to create the thing in 2 places if I don't get the thing from the response! Commented Mar 9, 2019 at 0:55
  • I'm generating Id on the front end is not bad practice. It is dangerous. How do you manage each object has different Id? Commented Mar 9, 2019 at 9:32
  • My _id_s are UUIDs randomly generated and are thus highly probable to be unique. They are sent to the backend. Sure someone could make a non-client API call with a conflicting UUID, but the backend will return a non-200 status code. I could definitely be naive, but thoughts on why that could be dangerous? Commented Mar 9, 2019 at 9:54