refactored frequency_khz to frequencies
This commit is contained in:
@@ -28,11 +28,11 @@ async def create_system_route():
|
||||
if name_search_result:
|
||||
abort(409, f"System with name '{request_data['name']}' already exists")
|
||||
|
||||
# Check if frequency_khz exists (optional, depending on requirements)
|
||||
if 'frequency_khz' in request_data:
|
||||
freq_search_result = await current_app.sys_db_h.find_system({"frequency_khz": request_data["frequency_khz"]})
|
||||
# Check if frequencies exists (optional, depending on requirements)
|
||||
if 'frequencies' in request_data:
|
||||
freq_search_result = await current_app.sys_db_h.find_system({"frequencies": request_data["frequencies"]})
|
||||
if freq_search_result:
|
||||
abort(409, f"System with frequency '{request_data['frequency_khz']}' already exists")
|
||||
abort(409, f"System with frequency '{request_data['frequencies']}' already exists")
|
||||
|
||||
created_system = await current_app.sys_db_h.create_system(request_data)
|
||||
|
||||
@@ -262,8 +262,8 @@ async def dismiss_client_from_system_route(system_id: str):
|
||||
async def search_systems_route():
|
||||
"""
|
||||
API endpoint to search for systems based on query parameters.
|
||||
Allows searching by 'name', 'frequency_khz', or any other field present in the System model.
|
||||
Example: /systems/search?name=MySystem&frequency_khz=1000
|
||||
Allows searching by 'name', 'frequencies', or any other field present in the System model.
|
||||
Example: /systems/search?name=MySystem&frequencies=1000
|
||||
"""
|
||||
print("\n--- Handling GET /systems/search ---")
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user