Skip to content

Commit

Permalink
Merge pull request #485 from bandada-infra/fix/api-sdk
Browse files Browse the repository at this point in the history
Missing cascade remove for invites preventing deletion of groups
  • Loading branch information
vplasencia authored Apr 10, 2024
2 parents 23e1f65 + 557f2ea commit 6766a09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/api/src/app/groups/entities/group.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from "typeorm"
import { OAuthAccount } from "../../credentials/entities/credentials-account.entity"
import { Member } from "./member.entity"
import { Invite } from "../../invites/entities/invite.entity"

@Entity("groups")
export class Group {
Expand Down Expand Up @@ -47,6 +48,11 @@ export class Group {
})
members: Member[]

@OneToMany(() => Invite, (invite) => invite.group, {
cascade: ["remove"]
})
invites: Invite[]

@OneToMany(() => OAuthAccount, (account) => account.group, {
cascade: ["insert"]
})
Expand Down

0 comments on commit 6766a09

Please sign in to comment.