mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 01:35:18 -04:00
Refactor(note): Remove shortid from note
This is a 1.x relict and isn't used anymore in 2.x. All 1.x shortids will be converted to aliases on migration of 1.x to 2.x. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
ac01521d82
commit
8c562016ab
5 changed files with 2 additions and 32 deletions
|
@ -4,7 +4,6 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { generate as shortIdGenerate } from 'shortid';
|
||||
import {
|
||||
Column,
|
||||
Entity,
|
||||
|
@ -27,11 +26,6 @@ import { MediaUpload } from '../media/media-upload.entity';
|
|||
export class Note {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
})
|
||||
shortid: string;
|
||||
@Column({
|
||||
unique: true,
|
||||
nullable: true,
|
||||
|
@ -87,12 +81,8 @@ export class Note {
|
|||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
private constructor() {}
|
||||
|
||||
public static create(owner?: User, alias?: string, shortid?: string): Note {
|
||||
if (!shortid) {
|
||||
shortid = shortIdGenerate();
|
||||
}
|
||||
public static create(owner?: User, alias?: string): Note {
|
||||
const newNote = new Note();
|
||||
newNote.shortid = shortid;
|
||||
newNote.alias = alias ?? null;
|
||||
newNote.viewCount = 0;
|
||||
newNote.owner = owner ?? null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue