🐛 (sheets) Fix can't start bot when filter is undefined

This commit is contained in:
Baptiste Arnaud
2023-03-17 07:42:42 +01:00
parent f9964e3f60
commit be7c0fc0d0
5 changed files with 15 additions and 14 deletions

View File

@@ -43,7 +43,7 @@ export const getRow = async (
const filteredRows = rows.filter((row) =>
referenceCell
? row[referenceCell.column as string] === referenceCell.value
: matchFilter(row, filter)
: matchFilter(row, filter as NonNullable<typeof filter>)
)
if (filteredRows.length === 0) {
log = {
@@ -104,7 +104,7 @@ export const getRow = async (
const matchFilter = (
row: GoogleSpreadsheetRow,
filter: GoogleSheetsGetOptions['filter']
filter: NonNullable<GoogleSheetsGetOptions['filter']>
) => {
return filter.logicalOperator === LogicalOperator.AND
? filter.comparisons.every(