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 { 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',

View File

@@ -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 />