Fix new services implementation 11
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user