This commit is contained in:
IGNY8 VPS (Salman)
2025-11-21 03:58:29 +00:00
parent 5106f7b200
commit b293856ef2
9 changed files with 515 additions and 61 deletions

View File

@@ -116,12 +116,23 @@ export const integrationApi = {
url: string;
username: string;
app_password: string;
api_key?: string;
is_active?: boolean;
sync_enabled?: boolean;
}
): Promise<SiteIntegration> {
const existing = await this.getWordPressIntegration(siteId);
const credentials: Record<string, string> = {
username: data.username,
app_password: data.app_password,
};
// Include API key if provided
if (data.api_key) {
credentials.api_key = data.api_key;
}
const integrationData: CreateIntegrationData = {
site: siteId,
platform: 'wordpress',
@@ -129,10 +140,7 @@ export const integrationApi = {
config_json: {
site_url: data.url,
},
credentials_json: {
username: data.username,
app_password: data.app_password,
},
credentials_json: credentials,
is_active: data.is_active ?? true,
sync_enabled: data.sync_enabled ?? true,
};