Commit da2d8128 authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

make order admin sort by date

parent 9f492c28
...@@ -9,7 +9,7 @@ const AdminOrderController = { ...@@ -9,7 +9,7 @@ const AdminOrderController = {
*/ */
async index(req, res) { async index(req, res) {
try { try {
let order = await db.order.findMany({ orderBy: { id: "desc" } }); let order = await db.order.findMany({ orderBy: { date: "desc" } });
res.json(order); res.json(order);
} catch (err) { } catch (err) {
res.status(403).json({ status: 403, message: "error something" }); res.status(403).json({ status: 403, message: "error something" });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment