- Add missing core module files: crud_ops.py, db_tables.py, init_db.py, user_context.py - Ensure all .dspy scripts properly use get_user() for user_id acquisition - Fix user context handling in module functions via get_current_user_id() - Maintain proper async/await patterns throughout the codebase - Complete module implementation following module-development-spec - All database operations use sqlor framework with proper user isolation
18 lines
669 B
Plaintext
18 lines
669 B
Plaintext
1|# Remove a service by ID
|
|
2|# This .dspy file uses functions provided by load_hermes_web_cli()
|
|
3|
|
|
4|try:
|
|
5| service_id = params_kw.get('id')
|
|
6| if not service_id:
|
|
7| return {"error": "Service ID is required"}
|
|
8|
|
|
9| # Call the function provided by the hermes-web-cli module
|
|
10| success = await delete_service(service_id)
|
|
11|
|
|
12| if success:
|
|
13| return {"success": True, "message": "Service removed successfully"}
|
|
14| else:
|
|
15| return {"error": "Failed to remove service"}
|
|
16|
|
|
17|except Exception as e:
|
|
18| return {"error": str(e)} |