Skip to content

REST - create data with server side ID #2147

Discussion options

You must be logged in to vote

Hey @exinferis - thanks for filing this issue. I agree this can be a little fiddly with MST. At a high level, I think you can smooth things over by thinking about two distinct models in your MST codebase:

  1. The ViewModel, which models the state of your application, but does not need to have full parity with your server state or database modeling
  2. Individual models that do duplicate your server-side modeling, but can be passed around and handled by the ViewModel.

These two things can interact with one another, and you can model this whole flow through the ViewModel itself, but also handle actual server alongside.

Here's how I would do this in my own app:

import { types, getSnapshot, Snapsho…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by coolsoftwaretyler
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Question or help request
2 participants
Converted from issue

This discussion was converted from issue #2143 on February 21, 2024 15:41.