feat: add list of aliases to note entity

One of the aliases can be primary for each note, but all can be used to get information from the apis.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-06-06 17:46:32 +02:00
parent 7dd4f97d64
commit aaef0f72ba
6 changed files with 115 additions and 13 deletions

View file

@ -0,0 +1,22 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { ValueTransformer } from 'typeorm';
export class PrimaryValueTransformer implements ValueTransformer {
from(value: boolean | null): boolean {
if (value === null) {
return false;
}
return value;
}
to(value: boolean): boolean | null {
if (!value) {
return null;
}
return value;
}
}