From f04444bb1b7d99112dcfb686cf9de8412d2780df Mon Sep 17 00:00:00 2001 From: Holly Date: Sun, 13 Oct 2024 16:55:23 +0100 Subject: [PATCH] fix badge creation --- server/repos/BadgeRepo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/repos/BadgeRepo.ts b/server/repos/BadgeRepo.ts index 02a361f..c6961db 100644 --- a/server/repos/BadgeRepo.ts +++ b/server/repos/BadgeRepo.ts @@ -48,7 +48,7 @@ export default abstract class BadgeRepo { public static async insertUpdate(badge:Badge) { if (badge.Id === Number.MIN_VALUE) { - badge.Id = (await Database.Instance.query("INSERT Badge (Name, Description, Hint, ImageUrl, ForUrl, IsSecret, CreatedByUserId, CreatedDatetime, LastModifiedByUserId, LastModifiedDatetime, DeletedByUserId, DeletedDatetime, IsDeleted) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING Id;", [ + badge.Id = (await Database.Instance.query("INSERT Badge (Name, Description, Hint, ImageUrl, ForUrl, IsSecret, CreatedByUserId, CreatedDatetime, LastModifiedByUserId, LastModifiedDatetime, DeletedByUserId, DeletedDatetime, IsDeleted) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING Id;", [ badge.Name, badge.Description, badge.Hint, badge.ImageUrl, badge.ForUrl, Number(badge.IsSecret), badge.CreatedByUserId, badge.CreatedDatetime.getTime(), badge.LastModifiedByUserId ?? null, badge.LastModifiedDatetime?.getTime() ?? null, badge.DeletedByUserId ?? null, badge.DeletedDatetime?.getTime() ?? null, Number(badge.IsDeleted) ]))[0]["Id"]; } else {