mirror of
https://github.com/Lifeforge-app/lifeforge.git
synced 2026-06-28 14:55:45 +00:00
feat(server): enhance filter handling by allowing null values and updating tests for undefined/null elements
This commit is contained in:
@@ -73,6 +73,7 @@ type FilterType<
|
||||
filters: FilterType<TCollectionKey, TExpandConfig>
|
||||
}
|
||||
| undefined
|
||||
| null
|
||||
>
|
||||
|
||||
// Helper type for field selection object
|
||||
|
||||
@@ -30,6 +30,7 @@ type MockFilter =
|
||||
filters: MockFilter[]
|
||||
}
|
||||
| undefined
|
||||
| null
|
||||
|
||||
// Helper function to create filter with proper typing
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
@@ -359,7 +360,7 @@ describe('recursivelyBuildFilter', () => {
|
||||
expect(result.params).toEqual({})
|
||||
})
|
||||
|
||||
it('should handle filter array with undefined elements', () => {
|
||||
it('should handle filter array with undefined and null elements', () => {
|
||||
const filter = createFilter([
|
||||
undefined,
|
||||
{
|
||||
@@ -367,7 +368,8 @@ describe('recursivelyBuildFilter', () => {
|
||||
operator: '=',
|
||||
value: 'John'
|
||||
},
|
||||
undefined
|
||||
undefined,
|
||||
null
|
||||
])
|
||||
|
||||
const result = recursivelyBuildFilter(filter)
|
||||
|
||||
Reference in New Issue
Block a user