-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataStore Delete - Failed to execute 'index' on 'IDBObjectStore' #7049
Comments
Hi @myfairshare I have tried to reproduce your issue. However, it is working fine for me. Code: wei/amplify-js-7049 Feel free to try it and let me know if it works for you. If possible, please create a minimal reproducible example repo from scratch with amplify CLI 4.33.1 or on top of my repo so we can further assist you! Thank you! |
@myfairshare based on the auth rule on your Please try changing your schema to: type User
@model
@auth(rules: [{ allow: owner, ownerField: "userId" }]) {
id: ID!
userId: String
userType: UserType!
username: String!
email: String!
rentalUnits: [RentalUnit] @connection(keyName: "OwnerUnits", fields: ["userId"])
} Also, could you share the code for how you're saving and deleting records with these models? |
Thanks wei and iartemiev,
|
Hi Iartemiev, Have come back to this today and followed your suggestions with a slight change and have got delete working. I added the userId but was getting an error generating schema it would only take type ID! non nullable.
Then..
Here's my delete unit function..
I'm pretty much following the DataStore amplify docs as best I can, thanks again both of you for your help. |
@myfairshare it sounds like you were able to get this working then? If so, can we close this issue? |
Yes please, thanks again! |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Describe the bug
When I try to delete an item in DataStore which belongs to a 1 to many relationship I get the 'failed to execute 'index' on 'IDBObjectStore' error. I noticed in another issue DataStore has a problem with deleting such a relationship here..
##5088
Expected behavior
I expect the the user to be able to delete a rental unit
Code Snippet
My schema looks like this..a user has many rental units
Thank you for any suggestions.
The text was updated successfully, but these errors were encountered: