Skip to content

How does make() work? #1169

Answered by CodeDredd
garma83 asked this question in Q&A
Apr 7, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

HI,

If your primary key is an uid field in the model, then you can do this:

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. :)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@garma83
Comment options

Answer selected by CodeDredd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants