create api/orders/count.get endpoint

this api returns count of all orders
This commit is contained in:
Wroclaw 2023-12-18 23:15:01 +01:00
parent b12e91ed13
commit 8bd41f8df3

View file

@ -0,0 +1,9 @@
import { defineEventHandler } from "h3";
import { database } from "~/server/utils/database";
export default defineEventHandler(async (e) => {
return {
count: await database.order.count({}),
};
});