mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-24 04:27:27 +08:00
fix(core): skip undefined arg for collection migration (#12265)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved handling of filter arguments to exclude invalid or empty values, reducing potential errors during filtering operations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -191,7 +191,7 @@ export class CollectionStore extends Store {
|
|||||||
return filterList.map(filter => {
|
return filterList.map(filter => {
|
||||||
const leftValue = filter.left.name;
|
const leftValue = filter.left.name;
|
||||||
const method = filter.funcName;
|
const method = filter.funcName;
|
||||||
const args = filter.args.map(arg => arg.value);
|
const args = filter.args.filter(arg => !!arg).map(arg => arg.value);
|
||||||
const arg0 = args[0];
|
const arg0 = args[0];
|
||||||
if (leftValue === 'Created' || leftValue === 'Updated') {
|
if (leftValue === 'Created' || leftValue === 'Updated') {
|
||||||
const key = leftValue === 'Created' ? 'createdAt' : 'updatedAt';
|
const key = leftValue === 'Created' ? 'createdAt' : 'updatedAt';
|
||||||
|
|||||||
Reference in New Issue
Block a user