From b62a6d5f08c35e45e65f80405910c5e3a6560fd6 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Fri, 9 Sep 2022 01:38:03 +0200 Subject: [PATCH] Fixed a bug in the Media & ShortenedLink model --- models/Media.ts | 2 +- models/ShortenedLink.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/Media.ts b/models/Media.ts index 14d3b3c..a1f8890 100644 --- a/models/Media.ts +++ b/models/Media.ts @@ -13,7 +13,7 @@ export interface IMedia { const MediaSchema = new Schema({ assetId: { type: String, - default: crypto.randomBytes(12).toString('hex') + default: () => crypto.randomBytes(12).toString('hex') }, clientId: { type: Number, diff --git a/models/ShortenedLink.ts b/models/ShortenedLink.ts index e7c91b6..34cceee 100644 --- a/models/ShortenedLink.ts +++ b/models/ShortenedLink.ts @@ -12,7 +12,7 @@ export interface IShortenedLink { const ShortenedSchema = new Schema({ shortenedId: { type: String, - default: crypto.randomBytes(3).toString('hex') + default: () => crypto.randomBytes(3).toString('hex') }, originalUrl: { type: String,