fix: Jumpstart schema fix - use url instead of domain

CRITICAL FIX:
- Added 'config' and 'type' fields to generation_jobs collection
- Fixed JumpstartWizard to use 'url' field instead of non-existent 'domain' field
- Tested via API: Job creation now works successfully

Schema Changes (via Directus API):
- generation_jobs.config (json) - stores WordPress URL, auth, mode
- generation_jobs.type (string) - stores job type (Refactor, Import, etc.)

Frontend Changes:
- JumpstartWizard now looks up sites by 'url' field
- Properly handles URL normalization (adds https:// if missing)

Test Results:
-  API test: Job created successfully (ID: 7b97c4ae-bcb6-4c41-8883-83a0e742ccbd)
-  Site lookup works
-  Config field populated correctly

Ready for frontend testing after deployment.
This commit is contained in:
cawcenter
2025-12-13 18:53:22 -05:00
parent 813e9cc28c
commit 5baf4e32a0
6 changed files with 317 additions and 6 deletions

View File

@@ -133,12 +133,12 @@ export default function JumpstartWizard() {
const client = getDirectusClient();
// A. Find or Create Site
const domain = new URL(siteUrl).hostname;
const siteUrlFull = siteUrl.startsWith('http') ? siteUrl : `https://${siteUrl}`;
let siteId: string | number;
addLog(`🔎 Checking Site Record for ${domain}...`);
addLog(`🔎 Checking Site Record for ${siteUrlFull}...`);
const existingSites = await client.request(readItems('sites', {
filter: { domain: { _eq: domain } },
filter: { url: { _eq: siteUrlFull } },
limit: 1
}));
@@ -148,9 +148,8 @@ export default function JumpstartWizard() {
} else {
addLog(`✨ Creating new site record...`);
const newSite = await client.request(createItem('sites', {
name: domain,
domain: domain,
url: siteUrl
name: new URL(siteUrlFull).hostname,
url: siteUrlFull
}));
siteId = newSite.id;
}