Stelle Website-Projekte und Admin-Tabs nach Auto-Deploy-Reset wieder her.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Webklar Deploy
2026-05-25 06:41:35 +00:00
parent 8d62e353cb
commit fda673702e
10 changed files with 543 additions and 110 deletions

View File

@@ -0,0 +1,22 @@
import { account } from './appwrite'
const PROJECT_ADMIN_URL =
import.meta.env.VITE_PROJECT_ADMIN_URL || 'https://project.webklar.com'
export async function createProjectFromTemplate(payload) {
const jwt = await account.createJWT()
const response = await fetch(
`${PROJECT_ADMIN_URL}/api/admin/website-projects/create-from-template`,
{
method: 'POST',
headers: {
Authorization: `Bearer ${jwt.jwt}`,
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
}
)
const data = await response.json().catch(() => ({}))
if (!response.ok) throw new Error(data.error || `API-Fehler ${response.status}`)
return data
}