feat: handle empty store tools in ToolStoreDialog

This commit is contained in:
CaptainB 2025-09-12 11:17:50 +08:00
parent 823ac6b1a3
commit bd668e7e2a
2 changed files with 6 additions and 1 deletions

View File

@ -766,7 +766,7 @@ class ToolSerializer(serializers.Serializer):
os.unlink(temp_zip_path)
except requests.RequestException as e:
maxkb_logger.error(f"fetch appstore tools error: {e}")
return []
return {'apps': [], 'additionalProperties': {'tags': []}}
class AddStoreTool(serializers.Serializer):
user_id = serializers.UUIDField(required=True, label=_("User ID"))

View File

@ -175,6 +175,11 @@ async function getStoreToolList() {
const tags = res.data.additionalProperties.tags
const storeTools = res.data.apps
if (storeTools.length === 0) {
filterList.value = []
return
}
categories.value = tags.map((tag: any) => ({
id: tag.key,
title: tag.name, //