Browse Source

fix(core): Clean up unused dependencies in DefaultSearchPlugin

Michael Bromley 6 years ago
parent
commit
9b3cd260e7

+ 1 - 0
packages/core/src/plugin/default-search-plugin/default-search-plugin.ts

@@ -116,6 +116,7 @@ export class DefaultSearchPlugin implements VendurePlugin {
         ];
     }
 
+    /** @internal */
     defineWorkers(): Array<Type<any>> {
         return [
             IndexerController,

+ 1 - 1
packages/core/src/plugin/default-search-plugin/indexer/indexer.controller.ts

@@ -50,7 +50,7 @@ export class IndexerController {
     ) {}
 
     @MessagePattern(Message.Reindex)
-    reindex({ ctx: rawContext }: { ctx: any}): Observable<ReindexMessageResponse> {
+    reindex({ ctx: rawContext }: { ctx: any }): Observable<ReindexMessageResponse> {
         const ctx = RequestContext.fromObject(rawContext);
         return new Observable(observer => {
             (async () => {

+ 2 - 9
packages/core/src/plugin/default-search-plugin/indexer/search-index.service.ts

@@ -1,17 +1,13 @@
 import { Inject, Injectable, OnModuleDestroy } from '@nestjs/common';
 import { ClientProxy } from '@nestjs/microservices';
-import { InjectConnection } from '@nestjs/typeorm';
 import { ID } from '@vendure/common/lib/shared-types';
-import { Connection } from 'typeorm';
 
 import { RequestContext } from '../../../api/common/request-context';
-import { ConfigService } from '../../../config/config.service';
 import { Logger } from '../../../config/logger/vendure-logger';
 import { ProductVariant } from '../../../entity/product-variant/product-variant.entity';
 import { Product } from '../../../entity/product/product.entity';
 import { Job } from '../../../service/helpers/job-manager/job';
 import { JobService } from '../../../service/services/job.service';
-import { ProductVariantService } from '../../../service/services/product-variant.service';
 import { VENDURE_WORKER_CLIENT } from '../../../worker/constants';
 import { Message } from '../constants';
 
@@ -23,11 +19,8 @@ import { ReindexMessageResponse } from './indexer.controller';
 @Injectable()
 export class SearchIndexService implements OnModuleDestroy {
 
-    constructor(@InjectConnection() private connection: Connection,
-                @Inject(VENDURE_WORKER_CLIENT) private readonly client: ClientProxy,
-                private productVariantService: ProductVariantService,
-                private jobService: JobService,
-                private configService: ConfigService) {}
+    constructor(@Inject(VENDURE_WORKER_CLIENT) private readonly client: ClientProxy,
+                private jobService: JobService) {}
 
     reindex(ctx: RequestContext): Job {
         return this.jobService.createJob({