Skip to content

Commit

Permalink
fix(elasticsearch-plugin): Remove references to Decode decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jul 30, 2019
1 parent e660d46 commit 0d3d8ef
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/elasticsearch-plugin/src/elasticsearch-resolver.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { Args, Mutation, Parent, Query, ResolveProperty, Resolver } from '@nestjs/graphql';
import { JobInfo, Permission, QuerySearchArgs, SearchInput, SearchResponse } from '@vendure/common/lib/generated-types';
import {
JobInfo,
Permission,
QuerySearchArgs,
SearchInput,
SearchResponse,
} from '@vendure/common/lib/generated-types';
import { Omit } from '@vendure/common/lib/omit';
import { Allow, Ctx, Decode, FacetValue, RequestContext, SearchResolver } from '@vendure/core';
import { Allow, Ctx, FacetValue, RequestContext, SearchResolver } from '@vendure/core';

import { ElasticsearchService } from './elasticsearch.service';

@Resolver('SearchResponse')
export class ShopElasticSearchResolver implements Omit<SearchResolver, 'reindex'> {

constructor(private elasticsearchService: ElasticsearchService) {}

@Query()
@Allow(Permission.Public)
@Decode('facetValueIds', 'collectionId')
async search(
@Ctx() ctx: RequestContext,
@Args() args: QuerySearchArgs,
Expand All @@ -34,12 +38,10 @@ export class ShopElasticSearchResolver implements Omit<SearchResolver, 'reindex'

@Resolver('SearchResponse')
export class AdminElasticSearchResolver implements SearchResolver {

constructor(private elasticsearchService: ElasticsearchService) {}

@Query()
@Allow(Permission.ReadCatalog)
@Decode('facetValueIds', 'collectionId')
async search(
@Ctx() ctx: RequestContext,
@Args() args: QuerySearchArgs,
Expand All @@ -62,6 +64,5 @@ export class AdminElasticSearchResolver implements SearchResolver {
@Allow(Permission.UpdateCatalog)
async reindex(@Ctx() ctx: RequestContext): Promise<JobInfo> {
return this.elasticsearchService.reindex(ctx);

}
}

0 comments on commit 0d3d8ef

Please sign in to comment.