fix: updateWebsiteProject - kein hasPreview-Attribut, TLS-Sync nach Appwrite-Update
- hasPreview existiert im Live-Schema nicht -> Appwrite lehnte Update ab - syncPreviewTls muss NACH updateDocument laufen, sonst liest es isPublic noch im alten Zustand (oeffentlicher Router bekam faelschlich preview-auth) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -430,12 +430,6 @@ export async function updateWebsiteProject(projectId, { projectName, subdomain,
|
||||
}
|
||||
}
|
||||
|
||||
// Sicherstellen, dass die Traefik-Router den public/auth-Zustand widerspiegeln,
|
||||
// auch wenn kein Redeploy stattfand (z.B. nur Typ preview <-> website getauscht).
|
||||
try { await syncPreviewTls() } catch (err) {
|
||||
console.error('[updateWebsiteProject] TLS-Sync fehlgeschlagen:', err.message)
|
||||
}
|
||||
|
||||
const previewUrl = hasWebsite && nextSubdomain ? buildPreviewUrl(nextSubdomain) : ''
|
||||
const updated = await updateDocument(config.collections.websiteProjects, projectId, {
|
||||
projectName: nextName,
|
||||
@@ -443,7 +437,6 @@ export async function updateWebsiteProject(projectId, { projectName, subdomain,
|
||||
previewUrl,
|
||||
projectType: nextType,
|
||||
isPublic,
|
||||
hasPreview: hasWebsite,
|
||||
status: hasWebsite ? (deployResult.deployed ? 'deployed' : 'pending') : 'created',
|
||||
provisioningStatus: hasWebsite
|
||||
? (deployResult.deployed ? 'ready' : (deployResult.error ? 'deploy_failed' : 'pending'))
|
||||
@@ -451,6 +444,13 @@ export async function updateWebsiteProject(projectId, { projectName, subdomain,
|
||||
updatedAt: new Date().toISOString(),
|
||||
})
|
||||
|
||||
// TLS-Router NACH dem Appwrite-Update synchronisieren, damit der public/auth-
|
||||
// Zustand (isPublic) korrekt gelesen wird - auch wenn kein Redeploy stattfand
|
||||
// (z.B. nur Typ preview <-> website getauscht).
|
||||
try { await syncPreviewTls() } catch (err) {
|
||||
console.error('[updateWebsiteProject] TLS-Sync fehlgeschlagen:', err.message)
|
||||
}
|
||||
|
||||
return {
|
||||
project: updated,
|
||||
deploy: deployResult,
|
||||
|
||||
Reference in New Issue
Block a user