|
Hi, I imagine the purpose of the make() function is to provide a draft of the model, so it can be changed by the user and then persisted to the store and / or backend once the user is ready. However how should I do this? I can't seem to make changes to the model. I tried this: model.description = 'hi'; neither of these approaches seem to work Also, when I am ready to persist it how should I do this? |
Answered by
CodeDredd
Apr 9, 2023
Replies: 1 comment 1 reply
|
HI, If your primary key is an const modelRepo = useRepo(Model)
const model = modelRepo.make()
model.description = 'hi';
modelRepo.save(model);otherwiese you also need to pass the primary key which i think is clear why. :) |
1 reply
Answer selected by
CodeDredd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HI,
If your primary key is an
uidfield in the model, then you can do this:otherwiese you also need to pass the primary key which i think is clear why. :)