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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user