feat: Display received time and fix timestamp timezone conversion.
This commit is contained in:
@@ -29,7 +29,7 @@ app.get('/api/messages', async (req, res) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const [rows] = await db.execute(
|
const [rows] = await db.execute(
|
||||||
'SELECT id, sender, recipient, subject, body, received_at FROM emails WHERE recipient LIKE ? ORDER BY received_at DESC',
|
'SELECT id, sender, recipient, subject, body, CAST(received_at AS CHAR) as received_at FROM emails WHERE recipient LIKE ? ORDER BY received_at DESC',
|
||||||
[`%${recipient}%`]
|
[`%${recipient}%`]
|
||||||
);
|
);
|
||||||
res.json(rows);
|
res.json(rows);
|
||||||
|
|||||||
Reference in New Issue
Block a user