modified: backend/src/services/AqlExecutor.ts

This commit is contained in:
GEgorov
2025-10-07 22:27:12 +03:00
parent 34058b5101
commit dc61529d05

View File

@@ -195,25 +195,10 @@ export class AqlExecutor {
throw new Error(`Invalid JSON response: ${responseText.substring(0, 200)}`); throw new Error(`Invalid JSON response: ${responseText.substring(0, 200)}`);
} }
// Нормализуем ответ к формату QueryResult // Возвращаем данные как есть
let rows: any[];
let rowCount: number;
if (Array.isArray(data)) {
rows = data;
rowCount = data.length;
} else if (data && typeof data === 'object') {
// Если ответ - объект, оборачиваем его в массив
rows = [data];
rowCount = 1;
} else {
rows = [];
rowCount = 0;
}
return { return {
rows, rows: data,
rowCount, rowCount: Array.isArray(data) ? data.length : (data ? 1 : 0),
executionTime, executionTime,
}; };
} catch (error: any) { } catch (error: any) {