🚸 (sheets) Show info log instead of error when no rows are found
This commit is contained in:
@@ -11,6 +11,7 @@ import { saveErrorLog } from '@/features/logs/saveErrorLog'
|
||||
import { updateVariables } from '@/features/variables/updateVariables'
|
||||
import { deepParseVariables } from '@/features/variables/deepParseVariable'
|
||||
import { matchFilter } from './helpers/matchFilter'
|
||||
import { saveInfoLog } from '@/features/logs/saveInfoLog'
|
||||
|
||||
export const getRow = async (
|
||||
state: SessionState,
|
||||
@@ -48,10 +49,11 @@ export const getRow = async (
|
||||
)
|
||||
if (filteredRows.length === 0) {
|
||||
log = {
|
||||
status: 'error',
|
||||
status: 'info',
|
||||
description: `Couldn't find any rows matching the filter`,
|
||||
details: JSON.stringify(filter, null, 2),
|
||||
}
|
||||
await saveErrorLog({
|
||||
await saveInfoLog({
|
||||
resultId,
|
||||
message: log.description,
|
||||
})
|
||||
|
||||
@@ -10,6 +10,7 @@ import { ExecuteIntegrationResponse } from '@/features/chat/types'
|
||||
import { saveErrorLog } from '@/features/logs/saveErrorLog'
|
||||
import { saveSuccessLog } from '@/features/logs/saveSuccessLog'
|
||||
import { matchFilter } from './helpers/matchFilter'
|
||||
import { saveInfoLog } from '@/features/logs/saveInfoLog'
|
||||
|
||||
export const updateRow = async (
|
||||
{ result, typebot: { variables } }: SessionState,
|
||||
@@ -42,12 +43,12 @@ export const updateRow = async (
|
||||
)
|
||||
if (filteredRows.length === 0) {
|
||||
log = {
|
||||
status: 'error',
|
||||
status: 'info',
|
||||
description: `Could not find any row that matches the filter`,
|
||||
details: JSON.stringify(filter, null, 2),
|
||||
}
|
||||
result &&
|
||||
(await saveErrorLog({
|
||||
(await saveInfoLog({
|
||||
resultId: result.id,
|
||||
message: log.description,
|
||||
details: log.details,
|
||||
|
||||
Reference in New Issue
Block a user