fix: wrap plugin_settings index response in data key for trmnlp compatibility

The trmnlp APIClient unwraps a 'data' key from the response body, but
PluginSettingsController#index was returning a bare JSON array, causing
`trmnlp list` to always show "No plugins found." Update the controller
and corresponding test to use the `{'data': [...]}` envelope.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Oskar Manhart
2026-06-23 23:55:34 +02:00
committed by Benjamin Nussbaum
co-authored by Claude Sonnet 4.6
parent 7b7bee1dfa
commit 2b06fd4970
3 changed files with 5 additions and 2 deletions
+3
View File
@@ -45,3 +45,6 @@ yarn-error.log
/.github/skills
/docs/site
/docs/node_modules
/.envrc
/.direnv
@@ -34,7 +34,7 @@ class PluginSettingsController extends Controller
'plugin_id' => null,
]);
return response()->json($plugins);
return response()->json(['data' => $plugins]);
}
public function store(Request $request): JsonResponse
+1 -1
View File
@@ -33,7 +33,7 @@ it('GET /api/plugin_settings returns all user plugins with null plugin_id', func
$response = $this->getJson('/api/plugin_settings');
$response->assertOk();
$data = $response->json();
$data = $response->json('data');
expect($data)->toHaveCount(2);
expect($data[0])->toMatchArray(['id' => 'uuid-1', 'name' => 'Alpha', 'plugin_id' => null]);
expect($data[1])->toMatchArray(['id' => 'uuid-2', 'name' => 'Beta', 'plugin_id' => null]);