Basic data enrichment (#3023)
* Add Enrich to frontend * Naive backend implementation * Add work email check * Rename Enrich to Quick Action * Refactor logic to a separate service * Refacto to separate IntelligenceService * Small fixes * Missing Break statement * Address PR comments * Create company interface * Improve edge case handling * Use httpService instead of Axios * Fix server tests
This commit is contained in:
@ -181,7 +181,7 @@ export class WorkspaceQueryRunnerService {
|
||||
)?.records;
|
||||
}
|
||||
|
||||
private async execute(
|
||||
async execute(
|
||||
query: string,
|
||||
workspaceId: string,
|
||||
): Promise<PGGraphQLResult | undefined> {
|
||||
@ -215,7 +215,7 @@ export class WorkspaceQueryRunnerService {
|
||||
const errors = graphqlResult?.[0]?.resolve?.errors;
|
||||
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
console.error('GraphQL errors', errors);
|
||||
console.error(`GraphQL errors on ${command}${targetTableName}`, errors);
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
@ -224,4 +224,15 @@ export class WorkspaceQueryRunnerService {
|
||||
|
||||
return parseResult(result);
|
||||
}
|
||||
|
||||
async executeAndParse<Result>(
|
||||
query: string,
|
||||
targetTableName: string,
|
||||
command: string,
|
||||
workspaceId: string,
|
||||
): Promise<Result> {
|
||||
const result = await this.execute(query, workspaceId);
|
||||
|
||||
return this.parseResult(result, targetTableName, command);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user