mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 02:05:21 -04:00
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:
parent
86d060706f
commit
17c55195c3
6 changed files with 115 additions and 13 deletions
22
src/notes/primary.value-transformer.ts
Normal file
22
src/notes/primary.value-transformer.ts
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue