fix(db-mongodb): destructuring error when trying to filter date fields by string query (#9116)
Previously, when filtering the internal link relationship in lexical by typing in the relationship field, it would throw an error, as that relationship field has a relation to "date-fields".
This commit is contained in:
@@ -89,11 +89,7 @@ export async function buildSearchParam({
|
||||
const [{ field, path }] = paths
|
||||
|
||||
if (path) {
|
||||
const {
|
||||
operator: formattedOperator,
|
||||
rawQuery,
|
||||
val: formattedValue,
|
||||
} = sanitizeQueryValue({
|
||||
const sanitizedQueryValue = sanitizeQueryValue({
|
||||
field,
|
||||
hasCustomID,
|
||||
operator,
|
||||
@@ -101,6 +97,12 @@ export async function buildSearchParam({
|
||||
val,
|
||||
})
|
||||
|
||||
if (!sanitizedQueryValue) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
const { operator: formattedOperator, rawQuery, val: formattedValue } = sanitizedQueryValue
|
||||
|
||||
if (rawQuery) {
|
||||
return { value: rawQuery }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user