Skip to content
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

Support Deleting Many Relationships #58

Open
GregBrimble opened this issue Nov 19, 2019 · 2 comments
Open

Support Deleting Many Relationships #58

GregBrimble opened this issue Nov 19, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@GregBrimble
Copy link
Member

Right now:

instance.relations = [instance, otherInstance]
await instanceRepo.save(instance)

instance.relations = [instance]
await instanceRepo.save(instance)

await instance.relations // [instance, otherInstance]
@GregBrimble GregBrimble added the bug Something isn't working label Nov 19, 2019
@GregBrimble
Copy link
Member Author

Some sort of array-like interface?

type oneToManyType<T> =
  | T[]
  | {
      push(value: T): void
      pop(): T
      clear(): void
    }
  | AsyncGenerator<T>

@GregBrimble
Copy link
Member Author

Add instanceRepo.delete(instance) method, and use that for some funky deletion stuff for these many relationship values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant