refactors

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-01 03:42:31 +00:00
parent 861ca016aa
commit 55a00bf1ad
7 changed files with 498 additions and 18 deletions

View File

@@ -91,11 +91,13 @@ export const integrationApi = {
*/
async syncIntegration(
integrationId: number,
syncType: 'full' | 'incremental' = 'incremental'
): Promise<{ success: boolean; message: string; synced_count?: number }> {
syncType: 'metadata' | 'incremental' | 'full' = 'metadata'
): Promise<{ success: boolean; message: string; post_types?: any; taxonomies?: any; last_sync_at?: string }> {
return await fetchAPI(`/v1/integration/integrations/${integrationId}/sync/`, {
method: 'POST',
body: JSON.stringify({ sync_type: syncType }),
body: JSON.stringify({
direction: syncType === 'metadata' ? 'metadata' : 'both'
}),
});
},