🐛 (sheets) Fix sheet block when filter is undefined
This commit is contained in:
@ -44,7 +44,7 @@ export const getRow = async (
|
||||
rows.filter((row) =>
|
||||
referenceCell
|
||||
? row[referenceCell.column as string] === referenceCell.value
|
||||
: matchFilter(row, filter as NonNullable<typeof filter>)
|
||||
: matchFilter(row, filter)
|
||||
)
|
||||
)
|
||||
if (filteredRows.length === 0) {
|
||||
|
@ -8,8 +8,9 @@ import { GoogleSpreadsheetRow } from 'google-spreadsheet'
|
||||
|
||||
export const matchFilter = (
|
||||
row: GoogleSpreadsheetRow,
|
||||
filter: NonNullable<GoogleSheetsGetOptions['filter']>
|
||||
filter: GoogleSheetsGetOptions['filter']
|
||||
) => {
|
||||
if (!filter) return true
|
||||
return filter.logicalOperator === LogicalOperator.AND
|
||||
? filter.comparisons.every(
|
||||
(comparison) =>
|
||||
|
Reference in New Issue
Block a user