refactor(pinia-orm): Bring more consistence into saving functions
🔗 Linked issue
related to #774
❓ Type of change
- [x] 📖 Documentation (updates to the documentation or readme)
- [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
- [x] 👌 Enhancement (improving an existing functionality like performance)
- [x] ✨ New feature (a non-breaking change that adds functionality)
- [x] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
📚 Description
This refactoring brings more consistency to the insert, save & update functions. It also adds the missing update
function on repository level.
📝 Checklist
- [ ] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
First of all, congratulations! This library is awesome :tada: Thanks for you effort on improving it!
I'm glad to see that now I could use insert method and keep relationships saved! Today I had to change all my SomeLib.fresh(data) calls with this combination of code to keep relations and not break my code:
SomeLib.flush();
SomeLib.save(data);
I understand that with this PR now the fresh function will preserve models relationships, is it?
I see this PR very usefull, many thanks! :+1:
@mllull nice to hear that...but as you noticed i havn't merged it for 1.5.0 because it's a breaking change for insert. So this PR will be the start for v2.0.0 i guess. ^^
understand that with this PR now the fresh function will preserve models relationships, is it?
Yes.