fix badge creation
This commit is contained in:
parent
494ce3fbce
commit
f04444bb1b
1 changed files with 1 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue