question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

persistBy: "create" not deleteAll data on relation

See original GitHub issue

Hello

I found bug with { persistBy: “create” } the item relation is not clear or deleteAll() before/after call order.api()

please review this bug from codesanbox https://codesandbox.io/s/vuex-orm-relation-test-h6xmb?file=/src/App.vue

** item is exists after call order.api() **

   await Order.api().get("/orders.json", {
     persistBy: "create",
     persistOptions: {
       create: ["merchant_item"]
     }
   });

or

   await Order.api().get("/orders.json", {
     persistBy: "create",
   });

I thank when set “persistBy: “create”,” or persistOptions deleteALl() any data on relations so will be correct

Thank you.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cuebitcommented, Jul 2, 2020

what do you think if there are support deleteAll option on persistOptions for the choice to clear all relation data before call this { persistBy }

There will be support for this feature in the next iteration of Vuex ORM. For the time being you may have to resort to the more verbose approach.

0reactions
mean-cjcommented, Jul 21, 2020

I think action only catch because save() return PromiseValue is undefined

console.log( orders.save() )

Promise {<pending>}
__proto__: Promise
[[PromiseStatus]]: "resolved"
[[PromiseValue]]: undefined 
Read more comments on GitHub >

github_iconTop Results From Across the Web

JPA , many-to-many relation, deleting all previous relations ...
I might be wrong but I think this is normal that when you're making your insertions, Hibernate firsts deletes all the records from...
Read more >
Solved: Cannot delete an entity relationship
Solved: I wanted to delete an entity relationship 1:N, but I kept getting the same message saying = there are dependencies...you cannot delete...
Read more >
Clear browsing data - Computer - Google Chrome Help
You can control your history and other browsing data, like saved form entries. You can delete all of your data or just some...
Read more >
Delete all data in Postgres database - DBA Stack Exchange
If you then create the SQL dump including the create table statements (so without the --data-only option) everything should be fine.
Read more >
DELETE command - HighBond
To delete all record notes, and the auto-generated RecordNote field, ... The data file (.fil) associated with the table layout is not deleted...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found