Skip to content

Commit

Permalink
Make sure to reply only json in the export/import api
Browse files Browse the repository at this point in the history
  • Loading branch information
andergmartins committed Dec 6, 2024
1 parent 51d73bb commit 16f0889
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Modules/Backup/Controllers/BackupRestApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ public function exportBackup(WP_REST_Request $request)
$selectedSettings = $request->get_param('settings');

if (! $exportActionWorkflows && ! $exportActionSettings) {
return new \WP_Error('invalid_request', 'Invalid request');
return new WP_REST_Response(
[
'message' => 'No export action selected',
'ok' => false,
],
400
);
}

$exportData = [
Expand Down

0 comments on commit 16f0889

Please sign in to comment.