feat: implement command functionality with new CommandController, update Query entity, and enhance query execution with headers support
This commit is contained in:
@ -34,7 +34,11 @@ export class QueryExecuterService {
|
||||
.trim();
|
||||
}
|
||||
|
||||
async runQuery(token: string, queryData: any) {
|
||||
async runQuery(
|
||||
token: string,
|
||||
queryData: any,
|
||||
headers: Record<string, any> = {}
|
||||
) {
|
||||
const query = await this.queryRepository.findOne({
|
||||
where: { id: token },
|
||||
relations: ["project"],
|
||||
@ -47,7 +51,8 @@ export class QueryExecuterService {
|
||||
const vm = await this.createVm(query);
|
||||
const result = await vm.runScript(
|
||||
this.clearImports(query.source),
|
||||
queryData
|
||||
queryData,
|
||||
headers
|
||||
);
|
||||
|
||||
return { message: "Query executed", result, query: queryData };
|
||||
|
||||
Reference in New Issue
Block a user