pinia-orm icon indicating copy to clipboard operation
pinia-orm copied to clipboard

refactor(pinia-orm): Bring more consistence into saving functions

Open CodeDredd opened this issue 3 years ago • 2 comments

🔗 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.

CodeDredd avatar Jan 03 '23 13:01 CodeDredd

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 avatar Jan 12 '23 16:01 mllull

@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.

CodeDredd avatar Jan 22 '23 18:01 CodeDredd