Skip to content

Commit

Permalink
Made search text type insensitive.
Browse files Browse the repository at this point in the history
Signed-off-by: aryan <aryan1bhokare@gmail.com>
  • Loading branch information
aryan-bhokare committed May 10, 2024
1 parent a24ba5e commit 6747199
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion chaoscenter/authentication/pkg/project/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/litmuschaos/litmus/chaoscenter/authentication/pkg/utils"

"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
Expand Down Expand Up @@ -114,7 +115,7 @@ func (r repository) GetProjectsByUserID(request *entities.ListProjectRequest) (*
pipeline = append(pipeline, bson.D{
{"$match", bson.D{
{"name", bson.D{
{"$regex", *request.Filter.ProjectName},
{"$regex", primitive.Regex{Pattern: *request.Filter.ProjectName, Options: "i"}},
}},
}},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const ProjectSearchBar = ({ state, dispatch, resetPage }: FilterProps): R
throttle={500}
autoFocus={false}
onChange={workflowName => {
if (!(state.projectName === workflowName)) {
if (!(state.projectName === workflowName.toLocaleLowerCase())) {
resetPage();
dispatch({
type: ProjectFilterActionKind.CHANGE_PROJECT_NAME,
Expand Down

0 comments on commit 6747199

Please sign in to comment.