mirror of
https://github.com/documenso/documenso.git
synced 2025-11-09 20:12:31 +10:00
fix: build errors
This commit is contained in:
@ -13,7 +13,7 @@ import type {
|
|||||||
export const getDocumentStats = async (filters: AnalyticsFilters): Promise<DocumentStats> => {
|
export const getDocumentStats = async (filters: AnalyticsFilters): Promise<DocumentStats> => {
|
||||||
const { dateFrom, dateTo, ...entityFilter } = filters;
|
const { dateFrom, dateTo, ...entityFilter } = filters;
|
||||||
|
|
||||||
const where: Prisma.DocumentWhereInput = {
|
const where: Prisma.EnvelopeWhereInput = {
|
||||||
...entityFilter,
|
...entityFilter,
|
||||||
deletedAt: null,
|
deletedAt: null,
|
||||||
...(dateFrom || dateTo
|
...(dateFrom || dateTo
|
||||||
@ -26,7 +26,7 @@ export const getDocumentStats = async (filters: AnalyticsFilters): Promise<Docum
|
|||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
const counts = await prisma.document.groupBy({
|
const counts = await prisma.envelope.groupBy({
|
||||||
by: ['status'],
|
by: ['status'],
|
||||||
where,
|
where,
|
||||||
_count: {
|
_count: {
|
||||||
@ -42,7 +42,7 @@ export const getDocumentStats = async (filters: AnalyticsFilters): Promise<Docum
|
|||||||
[ExtendedDocumentStatus.ALL]: 0,
|
[ExtendedDocumentStatus.ALL]: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
counts.forEach((stat) => {
|
counts.forEach((stat: { status: DocumentStatus; _count: { _all: number } }) => {
|
||||||
stats[stat.status as DocumentStatus] = stat._count._all;
|
stats[stat.status as DocumentStatus] = stat._count._all;
|
||||||
stats.ALL += stat._count._all;
|
stats.ALL += stat._count._all;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export const getRecipientStats = async (filters: AnalyticsFilters): Promise<Reci
|
|||||||
const { dateFrom, dateTo, ...entityFilter } = filters;
|
const { dateFrom, dateTo, ...entityFilter } = filters;
|
||||||
|
|
||||||
const where: Prisma.RecipientWhereInput = {
|
const where: Prisma.RecipientWhereInput = {
|
||||||
document: {
|
envelope: {
|
||||||
...entityFilter,
|
...entityFilter,
|
||||||
deletedAt: null,
|
deletedAt: null,
|
||||||
...(dateFrom || dateTo
|
...(dateFrom || dateTo
|
||||||
|
|||||||
Reference in New Issue
Block a user