mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
fix: invalid datetime on graph
This commit is contained in:
@ -17,9 +17,9 @@ type GetCompletedDocumentsMonthlyQueryResult = Array<{
|
||||
export const getCompletedDocumentsMonthly = async () => {
|
||||
const result = await prisma.$queryRaw<GetCompletedDocumentsMonthlyQueryResult>`
|
||||
SELECT
|
||||
DATE_TRUNC('month', "completedAt") AS "month",
|
||||
DATE_TRUNC('month', "updatedAt") AS "month",
|
||||
COUNT("id") as "count",
|
||||
SUM(COUNT("id")) OVER (ORDER BY DATE_TRUNC('month', "completedAt")) as "cume_count"
|
||||
SUM(COUNT("id")) OVER (ORDER BY DATE_TRUNC('month', "updatedAt")) as "cume_count"
|
||||
FROM "Document"
|
||||
WHERE "status" = 'COMPLETED'
|
||||
GROUP BY "month"
|
||||
|
||||
Reference in New Issue
Block a user