add created time
This commit is contained in:
parent
6b771cd0b7
commit
ed4e15e8e5
|
@ -134,9 +134,10 @@ router.get("/alerts/:mangoAccountPk", async (ctx, next) => {
|
||||||
router.post("/updates", async (ctx, next) => {
|
router.post("/updates", async (ctx, next) => {
|
||||||
try {
|
try {
|
||||||
const req: any = ctx.request.body
|
const req: any = ctx.request.body
|
||||||
|
const update = { ...req.update, date: Date.now() }
|
||||||
await validateUpdatePassword(req.password)
|
await validateUpdatePassword(req.password)
|
||||||
ctx.body = { status: "success" }
|
ctx.body = { status: "success" }
|
||||||
ctx.db.collection("updates").insertOne(req.update)
|
ctx.db.collection("updates").insertOne(update)
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
let errorMessage = "Something went wrong"
|
let errorMessage = "Something went wrong"
|
||||||
if (e.name == "UserError") {
|
if (e.name == "UserError") {
|
||||||
|
|
Loading…
Reference in New Issue