Skip to content

Commit

Permalink
fix: fix backwards compatibility for is:not:external search (#455)
Browse files Browse the repository at this point in the history
* fix: add backwards compatibility for is:not:external search

* chore: update openapi.json
  • Loading branch information
eric-nguyen-cs authored Mar 21, 2024
1 parent 9c87d1b commit dbedfb9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/editor/models/search_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def build_cypher_query(self, _param_name: str) -> CypherQuery:
case "external":
return CypherQuery("n.is_external = true")
case "not:external":
return CypherQuery("n.is_external = false")
return CypherQuery("(n.is_external IS NULL OR n.is_external = false)")
case _:
raise ValueError("Invalid filter value")

Expand Down
14 changes: 13 additions & 1 deletion backend/openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,11 @@
},
"type": "object",
"title": "Comments"
},
"isExternal": {
"type": "boolean",
"title": "Isexternal",
"default": false
}
},
"type": "object",
Expand Down Expand Up @@ -1330,7 +1335,14 @@
"IsFilterSearchTerm": {
"properties": {
"filterType": { "const": "is", "title": "Filtertype" },
"filterValue": { "const": "root", "title": "Filtervalue" }
"filterValue": {
"anyOf": [
{ "const": "root" },
{ "const": "external" },
{ "const": "not:external" }
],
"title": "Filtervalue"
}
},
"type": "object",
"required": ["filterType", "filterValue"],
Expand Down

0 comments on commit dbedfb9

Please sign in to comment.