Add MCP server and enhance AI content tools

Implement self-hosted MCP server for admin actions, update AI generation tools in admin dashboard, and refine mobile app stores and components.
This commit is contained in:
jjbrunton committed 2026-01-10 19:24:06 +00:00
1 parent b0f1700e40
commit 4e40b92b16
71 files changed
+10511 -1008

No files matched your search

+6 -1
View File
@@ -12,6 +12,7 @@ export interface Category {
icon: string | null;
sort_order: number | null;
created_at: string | null;
is_public: boolean;
pack_count?: number;
}
@@ -19,6 +20,7 @@ export interface CategoryFormData {
name: string;
description: string;
icon: string;
is_public: boolean;
}
// =============================================================================
@@ -85,10 +87,12 @@ export async function createCategory(
description: data.description || null,
icon: data.icon || null,
sort_order: sortOrder,
is_public: data.is_public ?? true,
});
if (error) throw error;
return created as Category;
if (!created || created.length === 0) throw new Error('Failed to create category');
return created[0] as Category;
}
/**
@@ -102,6 +106,7 @@ export async function updateCategory(
name: data.name,
description: data.description || null,
icon: data.icon || null,
is_public: data.is_public,
});
if (error) throw error;
+2 -1
View File
@@ -132,7 +132,8 @@ export async function createPack(
});
if (error) throw error;
return created as Pack;
if (!created || created.length === 0) throw new Error('Failed to create pack');
return created[0] as Pack;
}
/**
+3 -2
View File
@@ -84,7 +84,8 @@ export async function createQuestion(
});
if (error) throw error;
return created as Question;
if (!created || created.length === 0) throw new Error('Failed to create question');
return created[0] as Question;
}
/**
@@ -138,7 +139,7 @@ export async function bulkCreateQuestions(
});
if (error) throw error;
if (data) results.push(data as Question);
if (data && data.length > 0) results.push(data[0] as Question);
}
return results;