2
0

feat(results): remove incomplete results limitation

This commit is contained in:
Baptiste Arnaud
2022-07-20 08:38:10 +02:00
parent bd0d995c2c
commit 7d0a526736
2 changed files with 1 additions and 8 deletions

View File

@ -5,7 +5,6 @@ import { NextApiRequest, NextApiResponse } from 'next'
import { canReadTypebot, canWriteTypebot } from 'services/api/dbRules'
import { deleteFiles } from 'services/api/storage'
import { getAuthenticatedUser } from 'services/api/utils'
import { isFreePlan } from 'services/workspace'
import {
badRequest,
forbidden,
@ -38,7 +37,6 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
where: {
typebot: canReadTypebot(typebotId, user),
answers: { some: {} },
isCompleted: isFreePlan(workspace) ? true : undefined,
},
orderBy: {
createdAt: 'desc',

View File

@ -10,7 +10,6 @@ import { useWorkspace } from 'contexts/WorkspaceContext'
import { AnalyticsContent } from 'components/analytics/AnalyticsContent'
import { useRouter } from 'next/router'
import { useStats } from 'services/analytics'
import { isFreePlan } from 'services/workspace'
import { useToast } from 'components/shared/hooks/useToast'
import { ResultsProvider } from 'contexts/ResultsProvider'
@ -35,6 +34,7 @@ const ResultsPage = () => {
stats: { ...stats, totalStarts: stats.totalStarts - total },
})
}
return (
<Flex overflow="hidden" h="100vh" flexDir="column">
<Seo
@ -87,11 +87,6 @@ const ResultsPage = () => {
workspaceId={workspace.id}
typebotId={publishedTypebot.typebotId}
totalResults={stats?.totalStarts ?? 0}
totalHiddenResults={
isFreePlan(workspace)
? (stats?.totalStarts ?? 0) - (stats?.totalCompleted ?? 0)
: undefined
}
onDeleteResults={handleDeletedResults}
>
<ResultsContent />