add created time

This commit is contained in:
saml33 2021-12-23 11:04:57 +11:00
parent 6b771cd0b7
commit ed4e15e8e5
1 changed files with 2 additions and 1 deletions

View File

@ -134,9 +134,10 @@ router.get("/alerts/:mangoAccountPk", async (ctx, next) => {
router.post("/updates", async (ctx, next) => {
try {
const req: any = ctx.request.body
const update = { ...req.update, date: Date.now() }
await validateUpdatePassword(req.password)
ctx.body = { status: "success" }
ctx.db.collection("updates").insertOne(req.update)
ctx.db.collection("updates").insertOne(update)
} catch (e: any) {
let errorMessage = "Something went wrong"
if (e.name == "UserError") {