diff --git a/src/hooks/sync-sites/use-sync-push.ts b/src/hooks/sync-sites/use-sync-push.ts index 2b2c1c963..458a77074 100644 --- a/src/hooks/sync-sites/use-sync-push.ts +++ b/src/hooks/sync-sites/use-sync-push.ts @@ -310,7 +310,8 @@ export function useSyncPush( { const response = await getIpcApi().pushArchive( remoteSiteId, archivePath, - options?.optionsToSync + options?.optionsToSync, + options?.specificSelectionPaths ); const stateAfterUpload = getPushState( selectedSite.id, remoteSiteId ); diff --git a/src/ipc-handlers.ts b/src/ipc-handlers.ts index 43a7472de..2cad5bb24 100644 --- a/src/ipc-handlers.ts +++ b/src/ipc-handlers.ts @@ -804,7 +804,8 @@ export async function pushArchive( event: IpcMainInvokeEvent, remoteSiteId: number, archivePath: string, - optionsToSync?: string[] + optionsToSync?: string[], + specificSelectionPaths?: string[] ): Promise< { success: boolean; error?: string } > { const token = await getAuthenticationToken(); @@ -824,7 +825,13 @@ export async function pushArchive( ], ]; - if ( optionsToSync ) { + if ( specificSelectionPaths && specificSelectionPaths.length > 0 ) { + const options = optionsToSync ? [ ...optionsToSync, 'paths' ] : [ 'paths' ]; + formData.push( [ 'options', options.join( ',' ) ] ); + + const joinedPaths = specificSelectionPaths.join( ',' ); + formData.push( [ 'include_path_list', joinedPaths ] ); + } else if ( optionsToSync ) { formData.push( [ 'options', optionsToSync.join( ',' ) ] ); } diff --git a/src/preload.ts b/src/preload.ts index 058840343..955c6bb5f 100644 --- a/src/preload.ts +++ b/src/preload.ts @@ -24,8 +24,14 @@ const api: IpcApi = { archiveSite: ( id, format ) => ipcRendererInvoke( 'archiveSite', id, format ), exportSiteForPush: ( id, operationId, configuration ) => ipcRendererInvoke( 'exportSiteForPush', id, operationId, configuration ), - pushArchive: ( remoteSiteId, archivePath, optionsToSync ) => - ipcRendererInvoke( 'pushArchive', remoteSiteId, archivePath, optionsToSync ), + pushArchive: ( remoteSiteId, archivePath, optionsToSync, specificSelectionPaths ) => + ipcRendererInvoke( + 'pushArchive', + remoteSiteId, + archivePath, + optionsToSync, + specificSelectionPaths + ), deleteSite: ( id, deleteFiles ) => ipcRendererInvoke( 'deleteSite', id, deleteFiles ), createSite: ( path, config ) => ipcRendererInvoke( 'createSite', path, config ), updateSite: ( updatedSite ) => ipcRendererInvoke( 'updateSite', updatedSite ),