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 {