add options i #31

Merged
v4l3n71n merged 1 commits from feature/options-case into master 2024-11-28 22:19:17 +00:00

View File

@ -147,9 +147,9 @@ async def read_events(authorize: Annotated[bool, Depends(permissions_checker.Per
{"start_date": {"$lte": end_of_day}}
]}
if name is not None:
object_search = {"$and":[{"name":{"$regex": name}}, {"status":{"$eq":status}}]}
object_search = {"$and":[{"name":{"$regex": name, '$options': 'i'}}, {"status":{"$eq":status}}]}
if current_datetime is not None:
object_search = {"$and":[{"name":{"$regex": name}},
object_search = {"$and":[{"name":{"$regex": name, '$options': 'i'}},
{"status":{"$eq":status}},
{
"$or": [
@ -165,7 +165,7 @@ async def read_events(authorize: Annotated[bool, Depends(permissions_checker.Per
}
]}
if date_selected is True:
object_search = {"$and":[{"name":{"$regex": name}},
object_search = {"$and":[{"name":{"$regex": name, '$options': 'i'}},
{"status":{"$eq":status}},
{"start_date": {"$gte": start_of_day}},
{"start_date": {"$lte": end_of_day}}
@ -270,9 +270,9 @@ async def search_events(authorize: Annotated[bool, Depends(permissions_checker.P
"$and": [
{
"$or": [
{"name": {"$regex": item}},
{"name": {"$regex": item, "$options": 'i'}},
{"tags": {"$regex": item}},
{"organizers": {"$regex": item}}
{"organizers": {"$regex": item, "$options": 'i'}}
]
},
{"status": {"$eq": status}}
@ -283,9 +283,9 @@ async def search_events(authorize: Annotated[bool, Depends(permissions_checker.P
"$and": [
{
"$or": [
{"name": {"$regex": item}},
{"name": {"$regex": item, "$options": 'i'}},
{"tags": {"$regex": item}},
{"organizers": {"$regex": item}}
{"organizers": {"$regex": item, "$options": 'i'}}
]
},
{"status": {"$eq": status}},
@ -308,9 +308,9 @@ async def search_events(authorize: Annotated[bool, Depends(permissions_checker.P
"$and": [
{
"$or": [
{"name": {"$regex": item}},
{"name": {"$regex": item, "$options": 'i'}},
{"tags": {"$regex": item}},
{"organizers": {"$regex": item}}
{"organizers": {"$regex": item, "$options": 'i'}}
]
},
{"status": {"$eq": status}},
@ -323,9 +323,9 @@ async def search_events(authorize: Annotated[bool, Depends(permissions_checker.P
"$and": [
{
"$or": [
{"name": {"$regex": item}},
{"name": {"$regex": item, "$options": 'i'}},
{"tags": {"$regex": item}},
{"organizers": {"$regex": item}}
{"organizers": {"$regex": item, "$options": 'i'}}
]
},
{"status": {"$eq": status}},
@ -348,9 +348,9 @@ async def search_events(authorize: Annotated[bool, Depends(permissions_checker.P
"$and": [
{
"$or": [
{"name": {"$regex": item}},
{"name": {"$regex": item, "$options": 'i'}},
{"tags": {"$regex": item}},
{"organizers": {"$regex": item}}
{"organizers": {"$regex": item, "$options": 'i'}}
]
},
{"status": {"$eq": status}},
@ -385,9 +385,9 @@ async def search_events(authorize: Annotated[bool, Depends(permissions_checker.P
"$and": [
{
"$or": [
{"name": {"$regex": item}},
{"name": {"$regex": item, "$options": 'i'}},
{"tags": {"$regex": item}},
{"organizers": {"$regex": item}}
{"organizers": {"$regex": item, "$options": 'i'}}
]
},
{"status": {"$eq": status}},