feat(results): remove incomplete results limitation
This commit is contained in:
@@ -5,7 +5,6 @@ import { NextApiRequest, NextApiResponse } from 'next'
|
|||||||
import { canReadTypebot, canWriteTypebot } from 'services/api/dbRules'
|
import { canReadTypebot, canWriteTypebot } from 'services/api/dbRules'
|
||||||
import { deleteFiles } from 'services/api/storage'
|
import { deleteFiles } from 'services/api/storage'
|
||||||
import { getAuthenticatedUser } from 'services/api/utils'
|
import { getAuthenticatedUser } from 'services/api/utils'
|
||||||
import { isFreePlan } from 'services/workspace'
|
|
||||||
import {
|
import {
|
||||||
badRequest,
|
badRequest,
|
||||||
forbidden,
|
forbidden,
|
||||||
@@ -38,7 +37,6 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||||||
where: {
|
where: {
|
||||||
typebot: canReadTypebot(typebotId, user),
|
typebot: canReadTypebot(typebotId, user),
|
||||||
answers: { some: {} },
|
answers: { some: {} },
|
||||||
isCompleted: isFreePlan(workspace) ? true : undefined,
|
|
||||||
},
|
},
|
||||||
orderBy: {
|
orderBy: {
|
||||||
createdAt: 'desc',
|
createdAt: 'desc',
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import { useWorkspace } from 'contexts/WorkspaceContext'
|
|||||||
import { AnalyticsContent } from 'components/analytics/AnalyticsContent'
|
import { AnalyticsContent } from 'components/analytics/AnalyticsContent'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import { useStats } from 'services/analytics'
|
import { useStats } from 'services/analytics'
|
||||||
import { isFreePlan } from 'services/workspace'
|
|
||||||
import { useToast } from 'components/shared/hooks/useToast'
|
import { useToast } from 'components/shared/hooks/useToast'
|
||||||
import { ResultsProvider } from 'contexts/ResultsProvider'
|
import { ResultsProvider } from 'contexts/ResultsProvider'
|
||||||
|
|
||||||
@@ -35,6 +34,7 @@ const ResultsPage = () => {
|
|||||||
stats: { ...stats, totalStarts: stats.totalStarts - total },
|
stats: { ...stats, totalStarts: stats.totalStarts - total },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex overflow="hidden" h="100vh" flexDir="column">
|
<Flex overflow="hidden" h="100vh" flexDir="column">
|
||||||
<Seo
|
<Seo
|
||||||
@@ -87,11 +87,6 @@ const ResultsPage = () => {
|
|||||||
workspaceId={workspace.id}
|
workspaceId={workspace.id}
|
||||||
typebotId={publishedTypebot.typebotId}
|
typebotId={publishedTypebot.typebotId}
|
||||||
totalResults={stats?.totalStarts ?? 0}
|
totalResults={stats?.totalStarts ?? 0}
|
||||||
totalHiddenResults={
|
|
||||||
isFreePlan(workspace)
|
|
||||||
? (stats?.totalStarts ?? 0) - (stats?.totalCompleted ?? 0)
|
|
||||||
: undefined
|
|
||||||
}
|
|
||||||
onDeleteResults={handleDeletedResults}
|
onDeleteResults={handleDeletedResults}
|
||||||
>
|
>
|
||||||
<ResultsContent />
|
<ResultsContent />
|
||||||
|
|||||||
Reference in New Issue
Block a user