Spaces:
Runtime error
Runtime error
Commit
·
42e4293
1
Parent(s):
5b7e1eb
let's auto add the date
Browse files- src/index.mts +1 -1
src/index.mts
CHANGED
@@ -37,7 +37,7 @@ app.post("/post", async (req, res) => {
|
|
37 |
const prompt = `${req.body.prompt || ""}`
|
38 |
const assetUrl = `${req.body.assetUrl || ""}`
|
39 |
const previewUrl = `${req.body.previewUrl || assetUrl}`
|
40 |
-
const createdAt = `${req.body.createdAt ||
|
41 |
const upvotes = getValidNumber(req.body.upvotes, 0, 1e15, 0)
|
42 |
const downvotes = getValidNumber(req.body.upvotes, 0, 1e15, 0)
|
43 |
|
|
|
37 |
const prompt = `${req.body.prompt || ""}`
|
38 |
const assetUrl = `${req.body.assetUrl || ""}`
|
39 |
const previewUrl = `${req.body.previewUrl || assetUrl}`
|
40 |
+
const createdAt = `${req.body.createdAt || new Date().toISOString()}`
|
41 |
const upvotes = getValidNumber(req.body.upvotes, 0, 1e15, 0)
|
42 |
const downvotes = getValidNumber(req.body.upvotes, 0, 1e15, 0)
|
43 |
|