mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 07:43:16 +10:00
26 lines
557 B
TypeScript
26 lines
557 B
TypeScript
import cors from '@/lib/cors';
|
|
import { getCompletedDocumentsMonthly } from '@/lib/growth/get-monthly-completed-document';
|
|
|
|
export async function GET(request: Request) {
|
|
const completedDocuments = await getCompletedDocumentsMonthly();
|
|
|
|
return cors(
|
|
request,
|
|
new Response(JSON.stringify(completedDocuments), {
|
|
status: 200,
|
|
headers: {
|
|
'content-type': 'application/json',
|
|
},
|
|
}),
|
|
);
|
|
}
|
|
|
|
export function OPTIONS(request: Request) {
|
|
return cors(
|
|
request,
|
|
new Response(null, {
|
|
status: 204,
|
|
}),
|
|
);
|
|
}
|