WorkshopTasker/server/api/orders/count.get.ts
Wroclaw 8bd41f8df3 create api/orders/count.get endpoint
this api returns count of all orders
2023-12-18 23:15:01 +01:00

9 lines
207 B
TypeScript

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