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