mirror of
https://github.com/rowyio/rowy.git
synced 2026-07-12 21:39:28 +02:00
fix: algoliaIndex ingnoring false value fields
This commit is contained in:
@@ -3,6 +3,7 @@ export const dependencies = {
|
||||
};
|
||||
|
||||
const isEmpty = (obj) =>
|
||||
obj !== false &&
|
||||
[Object, Array].includes((obj || {}).constructor) &&
|
||||
!Object.entries(obj || {}).length;
|
||||
const get = (obj, path, defaultValue = undefined) => {
|
||||
@@ -46,13 +47,13 @@ const rowReducer = (fieldsToSync, row) =>
|
||||
...acc,
|
||||
[curr]: row[curr].toDate().getTime() / 1000,
|
||||
};
|
||||
} else if (!isEmpty(row[curr])) {
|
||||
} else if (row[curr] !== undefined || row[curr] !== null) {
|
||||
return { ...acc, [curr]: row[curr] };
|
||||
} else {
|
||||
return acc;
|
||||
}
|
||||
} else {
|
||||
if (!isEmpty(row[curr.fieldName]) && curr.snapshotFields) {
|
||||
if (row[curr.fieldName] && curr.snapshotFields) {
|
||||
return {
|
||||
...acc,
|
||||
[curr.fieldName]: row[curr.fieldName].map((snapshot) =>
|
||||
|
||||
Reference in New Issue
Block a user