-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(search): return user error when disabled engines are received ins…
…tead of ignoring
- Loading branch information
1 parent
c4e50c5
commit 583a59d
Showing
5 changed files
with
43 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package category | ||
|
||
import ( | ||
"slices" | ||
|
||
"github.com/hearchco/agent/src/search/engines" | ||
) | ||
|
||
// Returns true if the category contains any disabled engines. | ||
// Otherwise, returns false. | ||
func (c Category) ContainsDisabledEngines(disabledEngines []engines.Name) bool { | ||
for _, eng := range disabledEngines { | ||
if slices.Contains(c.Engines, eng) { | ||
return true | ||
} | ||
} | ||
|
||
return false | ||
} |