From de45ca428bd6a14eb072c26c59a81605b690e408 Mon Sep 17 00:00:00 2001 From: "Kyryll O." Date: Fri, 12 Jun 2026 17:53:48 +0300 Subject: [PATCH] fix: callPluginApi unwrap response (TransformInterceptor wrapping) --- src/backend/services/core.service.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/backend/services/core.service.ts b/src/backend/services/core.service.ts index 17ddd51..aa8bcea 100644 --- a/src/backend/services/core.service.ts +++ b/src/backend/services/core.service.ts @@ -162,10 +162,17 @@ export class CoreService { } async callPluginApi(pluginId: string, path: string, body?: any): Promise { - return this.fetchCore(`/api/plugins/rpc/${pluginId}/${path.replace(/^\//, '')}`, { + const res = await this.fetchCore(`/api/plugins/rpc/${pluginId}/${path.replace(/^\//, '')}`, { method: 'POST', body: body !== undefined ? JSON.stringify(body) : undefined, }); + if (res && typeof res === 'object' && res.success === true) { + if (res.data && typeof res.data === 'object' && res.data.success === true) { + return res.data.data as T; + } + return res.data as T; + } + return res as T; } async callAsService(pluginId: string, path: string, body?: any): Promise {