feat: Refactor Civitai model API routes and enhance RecipeContextMenu for missing LoRAs handling

This commit is contained in:
Will Miao
2025-04-18 16:44:26 +08:00
parent fafbafa5e1
commit 96e3b5b7b3
4 changed files with 218 additions and 31 deletions

View File

@@ -790,9 +790,9 @@ class RecipeModal {
// Determine which endpoint to use based on available data
if (lora.modelVersionId) {
endpoint = `/api/civitai/model/${lora.modelVersionId}`;
endpoint = `/api/civitai/model/version/${lora.modelVersionId}`;
} else if (lora.hash) {
endpoint = `/api/civitai/model/${lora.hash}`;
endpoint = `/api/civitai/model/hash/${lora.hash}`;
} else {
console.error("Missing both hash and modelVersionId for lora:", lora);
return null;