Fix /cc-create endpoint path mismatch (v2.19.2)

Corrected API endpoint paths from 'custom_command_creators' to 'custom_commands/creators' to match the database API routing structure.

**Issue**: Users unable to create custom commands due to 404 errors
**Root Cause**: Bot calling /api/v3/custom_command_creators instead of /api/v3/custom_commands/creators
**Solution**: Updated 5 endpoint references in custom_commands_service.py

Fixes:
- Line 547: create_item_in_table() call
- Lines 732, 748: client.put() calls for creator updates
- Lines 762, 768: get_items_from_table_with_params() calls for creator queries

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2025-11-24 21:20:28 -06:00
parent feff5b5a2b
commit 570f2e5e5a
2 changed files with 9 additions and 9 deletions

View File

@ -1 +1 @@
2.19.1 2.19.2

View File

@ -544,7 +544,7 @@ class CustomCommandsService(BaseService[CustomCommand]):
'active_commands': 0 'active_commands': 0
} }
result = await self.create_item_in_table('custom_command_creators', creator_data) result = await self.create_item_in_table('custom_commands/creators', creator_data)
if not result: if not result:
raise BotException("Failed to create command creator") raise BotException("Failed to create command creator")
@ -729,7 +729,7 @@ class CustomCommandsService(BaseService[CustomCommand]):
# Update creator via API # Update creator via API
try: try:
client = await self.get_client() client = await self.get_client()
await client.put('custom_command_creators', { await client.put('custom_commands/creators', {
'total_commands': total, 'total_commands': total,
'active_commands': active 'active_commands': active
}, object_id=creator_id) }, object_id=creator_id)
@ -737,15 +737,15 @@ class CustomCommandsService(BaseService[CustomCommand]):
self.logger.error(f"Failed to update creator {creator_id} stats: {e}") self.logger.error(f"Failed to update creator {creator_id} stats: {e}")
async def _update_creator_info( async def _update_creator_info(
self, self,
creator_id: int, creator_id: int,
username: str, username: str,
display_name: Optional[str] display_name: Optional[str]
) -> None: ) -> None:
"""Update creator username and display name.""" """Update creator username and display name."""
try: try:
client = await self.get_client() client = await self.get_client()
await client.put('custom_command_creators', { await client.put('custom_commands/creators', {
'username': username, 'username': username,
'display_name': display_name 'display_name': display_name
}, object_id=creator_id) }, object_id=creator_id)
@ -759,13 +759,13 @@ class CustomCommandsService(BaseService[CustomCommand]):
async def _get_creator_count(self) -> int: async def _get_creator_count(self) -> int:
"""Get total number of creators.""" """Get total number of creators."""
creators = await self.get_items_from_table_with_params('custom_command_creators', []) creators = await self.get_items_from_table_with_params('custom_commands/creators', [])
return len(creators) return len(creators)
async def _get_most_active_creator(self) -> Optional[CustomCommandCreator]: async def _get_most_active_creator(self) -> Optional[CustomCommandCreator]:
"""Get creator with most active commands.""" """Get creator with most active commands."""
creators = await self.get_items_from_table_with_params( creators = await self.get_items_from_table_with_params(
'custom_command_creators', 'custom_commands/creators',
[('sort', '-active_commands'), ('limit', 1)] [('sort', '-active_commands'), ('limit', 1)]
) )