alkem-io / server

Core server in the Alkemio platform, offering a GraphQL api for interacting with the logical domain model.
http://alkem.io
European Union Public License 1.2
24 stars 4 forks source link

BUG: Removing entity which has sub-entities, error is thrown #712

Closed Comoque1 closed 3 years ago

Comoque1 commented 3 years ago

Describe the bug When there is an Opportunity with sub-entity project, the opportunity cannot be removed and error is thrown.

To Reproduce Steps to reproduce the behavior:

  1. Navigate to: https://dev.cherrytwist.org/graphql
  2. Create the following entities:
    • Challenge > Opportunity > Project
  3. Delete the Opportunity Error is thrown: image.png

Expected behavior When removing an entity, all sub-entities must be removed

techsmyth commented 3 years ago

Note that there is another flag on TypeORM as per usage on Application entity: { eager: false, cascade: true, onDelete: 'CASCADE' }