User deletion now also delete's the users permissons

ref #6
This commit is contained in:
2020-12-18 15:49:42 +01:00
parent d4293c164d
commit ff3a5b4545
2 changed files with 10 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
import { IsInt, IsOptional } from 'class-validator';
import { IsInt } from 'class-validator';
import { Entity, OneToMany, PrimaryGeneratedColumn, TableInheritance } from 'typeorm';
import { ResponsePrincipal } from '../responses/ResponsePrincipal';
import { Permission } from './Permission';
@@ -19,9 +19,8 @@ export abstract class Principal {
/**
* permissions
*/
@IsOptional()
@OneToMany(() => Permission, permission => permission.principal, { nullable: true })
permissions?: Permission[];
permissions: Permission[];
public abstract toResponse(): ResponsePrincipal;
}