1
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user