chore(*): remove unused code (#6781)
The code removed in the PR was flagged as unused by the JetBrains inspector. I did a QA on the dev environment but other checks are highly recommended. There is one commit by scope to make the review easier. --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
import { TestingModule, Test } from '@nestjs/testing';
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
|
||||
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
||||
import { RecordPositionQueryFactory } from 'src/engine/api/graphql/workspace-query-builder/factories/record-position-query.factory';
|
||||
import { RecordPositionFactory } from 'src/engine/api/graphql/workspace-query-runner/factories/record-position.factory';
|
||||
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
||||
|
||||
describe('RecordPositionFactory', () => {
|
||||
const recordPositionQueryFactory = {
|
||||
create: jest.fn().mockResolvedValue('query'),
|
||||
create: jest.fn().mockReturnValue(['query', []]),
|
||||
};
|
||||
|
||||
let workspaceDataSourceService;
|
||||
|
||||
@ -134,7 +134,7 @@ export class QueryRunnerArgsFactory {
|
||||
),
|
||||
];
|
||||
case FieldMetadataType.NUMBER:
|
||||
return [key, await Promise.resolve(Number(value))];
|
||||
return [key, Number(value)];
|
||||
default:
|
||||
return [key, await Promise.resolve(value)];
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ export class RecordPositionFactory {
|
||||
dataSourceSchema: string,
|
||||
workspaceId: string,
|
||||
) {
|
||||
const [query, params] = await this.recordPositionQueryFactory.create(
|
||||
const [query, params] = this.recordPositionQueryFactory.create(
|
||||
recordPositionQueryArgs,
|
||||
objectMetadata,
|
||||
dataSourceSchema,
|
||||
|
||||
@ -66,10 +66,4 @@ export class WorkspaceQueryHookStorage {
|
||||
|
||||
this.postHookInstances.get(key)?.push(data);
|
||||
}
|
||||
|
||||
getWorkspaceQueryPostHookInstances(
|
||||
key: WorkspaceQueryHookKey,
|
||||
): WorkspaceQueryHookData<WorkspaceQueryHookInstance>[] | undefined {
|
||||
return this.postHookInstances.get(key);
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ import { WorkspaceQueryHookOptions } from 'src/engine/api/graphql/workspace-quer
|
||||
export class WorkspaceQueryHookMetadataAccessor {
|
||||
constructor(private readonly reflector: Reflector) {}
|
||||
|
||||
isWorkspaceQueryHook(target: Type<any> | Function): boolean {
|
||||
isWorkspaceQueryHook(target: Type | Function): boolean {
|
||||
if (!target) {
|
||||
return false;
|
||||
}
|
||||
@ -18,7 +18,7 @@ export class WorkspaceQueryHookMetadataAccessor {
|
||||
}
|
||||
|
||||
getWorkspaceQueryHookMetadata(
|
||||
target: Type<any> | Function,
|
||||
target: Type | Function,
|
||||
): WorkspaceQueryHookOptions | undefined {
|
||||
return this.reflector.get(WORKSPACE_QUERY_HOOK_METADATA, target);
|
||||
}
|
||||
|
||||
@ -1011,17 +1011,6 @@ export class WorkspaceQueryRunnerService {
|
||||
return parseResult(resultWithGetters);
|
||||
}
|
||||
|
||||
async executeAndParse<Result>(
|
||||
query: string,
|
||||
objectMetadataItem: ObjectMetadataInterface,
|
||||
command: string,
|
||||
workspaceId: string,
|
||||
): Promise<Result> {
|
||||
const result = await this.execute(query, workspaceId);
|
||||
|
||||
return this.parseResult(result, objectMetadataItem, command, workspaceId);
|
||||
}
|
||||
|
||||
async triggerWebhooks<Record>(
|
||||
jobsData: Record[] | undefined,
|
||||
operation: CallWebhookJobsJobOperation,
|
||||
|
||||
Reference in New Issue
Block a user