Skip to content

feat(pinia-orm): Add the possibility to rollback changed models.#757

Merged
CodeDredd merged 3 commits intonext-releasefrom
pinia-orm-756
Dec 22, 2022
Merged

feat(pinia-orm): Add the possibility to rollback changed models.#757
CodeDredd merged 3 commits intonext-releasefrom
pinia-orm-756

Conversation

@CodeDredd
Copy link
Copy Markdown
Owner

@CodeDredd CodeDredd commented Dec 22, 2022

🔗 Linked issue

closes #756

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Adds new functions to the model instance so you can check its state or refresh it to its original state.

const user = new User({ id: 1, name: 'John Doe' })

// Checks if an attribute was changed
user.$isDirty()

// Get its original state
user.$getOriginal()

// Rollback changes and return initial state
user.$refresh()

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@CodeDredd CodeDredd added the enhancement New feature or request label Dec 22, 2022
@CodeDredd CodeDredd self-assigned this Dec 22, 2022
@CodeDredd CodeDredd changed the base branch from master to next-release December 22, 2022 12:40
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 22, 2022

Codecov Report

❌ Patch coverage is 98.24561% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.71%. Comparing base (3930467) to head (300482d).

Files with missing lines Patch % Lines
packages/pinia-orm/src/support/Utils.ts 94.44% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           next-release     #757      +/-   ##
================================================
- Coverage         99.74%   99.71%   -0.04%     
================================================
  Files                85       85              
  Lines              5497     5551      +54     
  Branches            518      519       +1     
================================================
+ Hits               5483     5535      +52     
- Misses               14       16       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CodeDredd CodeDredd merged commit c27b223 into next-release Dec 22, 2022
@CodeDredd CodeDredd deleted the pinia-orm-756 branch December 22, 2022 18:02
@CodeDredd CodeDredd mentioned this pull request Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the possibilty to rollback changed models.

2 participants