-
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? |
Beta Was this translation helpful? Give feedback.
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. :) |
Beta Was this translation helpful? Give feedback.
HI,
If your primary key is an
uid
field in the model, then you can do this:otherwiese you also need to pass the primary key which i think is clear why. :)