create api/orders/count.get endpoint
this api returns count of all orders
This commit is contained in:
parent
b12e91ed13
commit
8bd41f8df3
1 changed files with 9 additions and 0 deletions
9
server/api/orders/count.get.ts
Normal file
9
server/api/orders/count.get.ts
Normal 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({}),
|
||||
};
|
||||
});
|
Loading…
Reference in a new issue