This commit is contained in:
Your Name committed 2026-06-19 18:58:07 -04:00
1 parent ce6fa69b09
commit 716bb98b50
4 files changed
+11 -8

No files matched your search

+1 -1
View File
@@ -191,7 +191,7 @@ export const MENU_TOOL_DEFINITIONS = [
}
] as const;
export const MENU_TOOL_NAMES = new Set(MENU_TOOL_DEFINITIONS.map((tool) => tool.name));
export const MENU_TOOL_NAMES = new Set<string>(MENU_TOOL_DEFINITIONS.map((tool) => tool.name));
export async function handleMenuTool(api: AxiosInstance, name: string, params: any) {
if (!MENU_TOOL_NAMES.has(name)) return null;
+3 -2
View File
@@ -142,16 +142,17 @@ function validateMenuNodeData(nodeData: any, parentId?: string | null) {
function validateMenuTranslations(translations: any) {
const issues: string[] = [];
const warnings: string[] = [];
if (!isPlainObject(translations)) {
issues.push("translations must be a plain object");
return { issues };
return { issues, warnings };
}
for (const [key, value] of Object.entries(translations)) {
if (typeof value !== "string") {
issues.push(`translation for "${key}" must be a string`);
}
}
return { issues };
return { issues, warnings };
}
function validateMenuItems(items: any) {
+1 -1
View File
@@ -253,7 +253,7 @@ export const SECTION_TOOL_DEFINITIONS = [
}
] as const;
export const SECTION_TOOL_NAMES = new Set(SECTION_TOOL_DEFINITIONS.map((tool) => tool.name));
export const SECTION_TOOL_NAMES = new Set<string>(SECTION_TOOL_DEFINITIONS.map((tool) => tool.name));
export async function handleSectionTool(api: AxiosInstance, name: string, params: any) {
if (!SECTION_TOOL_NAMES.has(name)) return null;
+6 -4
View File
@@ -68,16 +68,18 @@ function resolveApiBase() {
if (envValue) {
const isDev = Boolean(viteEnv?.DEV)
const isLocalhostUrl = /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?\/api\/?$/.test(envValue)
const win = (globalThis as any).window
if (isDev && typeof window !== 'undefined' && isLocalhostUrl) {
return `${window.location.protocol}//${window.location.hostname}:${DEFAULT_DEV_API_PORT}/api`
if (isDev && typeof win !== 'undefined' && isLocalhostUrl) {
return `${win.location.protocol}//${win.location.hostname}:${DEFAULT_DEV_API_PORT}/api`
}
return envValue
}
if (typeof window !== 'undefined') {
return `${window.location.protocol}//${window.location.hostname}:${DEFAULT_DEV_API_PORT}/api`
const win = (globalThis as any).window
if (typeof win !== 'undefined') {
return `${win.location.protocol}//${win.location.hostname}:${DEFAULT_DEV_API_PORT}/api`
}
return 'http://localhost:3000/api'