Now with cleaner participants in the responses

ref #6
This commit is contained in:
2020-12-18 15:26:54 +01:00
parent dc485c02ea
commit 145a08b1b4
5 changed files with 63 additions and 3 deletions

View File

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