modified: backend/src/controllers/dynamicApiController.ts
modified: backend/src/controllers/endpointController.ts
This commit is contained in:
@@ -202,9 +202,9 @@ export const executeDynamicEndpoint = async (req: ApiKeyRequest, res: Response)
|
|||||||
});
|
});
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
rows: scriptResult.data || scriptResult,
|
rows: scriptResult,
|
||||||
rowCount: scriptResult.rowCount || (Array.isArray(scriptResult.data) ? scriptResult.data.length : 0),
|
rowCount: 0,
|
||||||
executionTime: scriptResult.executionTime || 0,
|
executionTime: 0,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// Execute SQL query
|
// Execute SQL query
|
||||||
|
|||||||
@@ -333,9 +333,7 @@ export const testEndpoint = async (req: AuthRequest, res: Response) => {
|
|||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
success: true,
|
success: true,
|
||||||
data: scriptResult.data || scriptResult,
|
data: scriptResult,
|
||||||
rowCount: scriptResult.rowCount || (Array.isArray(scriptResult.data) ? scriptResult.data.length : 0),
|
|
||||||
executionTime: scriptResult.executionTime || 0,
|
|
||||||
});
|
});
|
||||||
} else if (execType === 'aql') {
|
} else if (execType === 'aql') {
|
||||||
if (!database_id) {
|
if (!database_id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user