Update Note entity

We now use the new permissions split in users and groups. Also the note now knows the colors of its authors.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-08-13 20:24:45 +02:00
parent 1121ed9507
commit 67e60a3c37
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
4 changed files with 47 additions and 71 deletions

View file

@ -1,12 +1,17 @@
import { Column, ManyToOne } from 'typeorm/index';
import { Column, Entity, ManyToOne } from 'typeorm/index';
import { Note } from '../notes/note.entity';
import { User } from '../users/user.entity';
@Entity()
export class NoteUserPermission {
@ManyToOne(_ => User)
@ManyToOne(_ => User, { primary: true })
user: User;
@ManyToOne(_ => Note)
@ManyToOne(
_ => Note,
note => note.userPermissions,
{ primary: true },
)
note: Note;
@Column()