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:
Philip Molares 2021-05-11 22:37:52 +02:00
parent ac01521d82
commit 8c562016ab
5 changed files with 2 additions and 32 deletions

View file

@ -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;