Fix new services implementation 11

This commit is contained in:
Urtzi Alfaro
2025-08-16 08:43:35 +02:00
parent 119beb541f
commit 995a51e285
8 changed files with 114 additions and 71 deletions

View File

@@ -304,9 +304,11 @@ private buildURL(endpoint: string): string {
}
const responseData = await response.json();
console.log('🔍 Raw responseData from fetch:', responseData);
// Apply response interceptors
const processedResponse = await this.applyResponseInterceptors(responseData);
console.log('🔍 processedResponse after interceptors:', processedResponse);
return processedResponse;
});
@@ -335,9 +337,14 @@ private buildURL(endpoint: string): string {
// Handle both wrapped and unwrapped responses
// If result has a 'data' property, return it; otherwise return the result itself
console.log('🔍 Final result before return:', result);
console.log('🔍 Result has data property?', result && typeof result === 'object' && 'data' in result);
if (result && typeof result === 'object' && 'data' in result) {
console.log('🔍 Returning result.data:', result.data);
return result.data as T;
}
console.log('🔍 Returning raw result:', result);
return result as T;
} catch (error) {
// Record error metrics