2
0

refactor(models): 🎨 Build types from validation schemas

This commit is contained in:
Baptiste Arnaud
2022-06-07 08:49:12 +02:00
parent c67fa7d9c1
commit e79ff09b0f
62 changed files with 1268 additions and 734 deletions

View File

@ -18,12 +18,14 @@ import { Plan } from 'db'
import { useToast } from 'components/shared/hooks/useToast'
type Props = {
workspaceId: string
typebotId: string
totalResults: number
totalHiddenResults?: number
onDeleteResults: (total: number) => void
}
export const SubmissionsContent = ({
workspaceId,
typebotId,
totalResults,
totalHiddenResults,
@ -51,6 +53,7 @@ export const SubmissionsContent = ({
const resultHeader = parseResultHeader(blocksAndVariables)
const { data, mutate, setSize, hasMore } = useResults({
workspaceId,
typebotId,
onError: (err) => showToast({ title: err.name, description: err.message }),
})
@ -125,7 +128,7 @@ export const SubmissionsContent = ({
const getAllTableData = async () => {
if (!publishedTypebot) return []
const results = await getAllResults(typebotId)
const results = await getAllResults(workspaceId, typebotId)
return convertResultsToTableData(results, resultHeader)
}