mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-27 13:34:28 -04:00
fix(repository): Move backend code into subdirectory
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
86584e705f
commit
bf30cbcf48
272 changed files with 87 additions and 67 deletions
19
backend/src/history/utils.ts
Normal file
19
backend/src/history/utils.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { getPrimaryAlias } from '../notes/utils';
|
||||
import { HistoryEntry } from './history-entry.entity';
|
||||
|
||||
export async function getIdentifier(entry: HistoryEntry): Promise<string> {
|
||||
const aliases = await (await entry.note).aliases;
|
||||
if (!aliases || aliases.length === 0) {
|
||||
return (await entry.note).publicId;
|
||||
}
|
||||
const primaryAlias = await getPrimaryAlias(await entry.note);
|
||||
if (primaryAlias === undefined) {
|
||||
return (await entry.note).publicId;
|
||||
}
|
||||
return primaryAlias;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue