Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Commit

Permalink
feat: update LiveToursResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
YanceyOfficial committed Mar 28, 2020
1 parent 179f4ce commit edd5d45
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/live-tours/live-tours.resolver.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { UseGuards } from '@nestjs/common'
import { Args, Query, Resolver, Mutation, ID } from '@nestjs/graphql'
import { LiveToursService } from './live-tours.service'
import { LiveTourModel } from './models/live-tours.model'
import { BatchDeleteModel } from '../database/models/batch-delete.model'
import { CreateLiveTourInput } from './dtos/create-live-tour.input'
import { UpdateLiveTourInput } from './dtos/update-live-tour.input'
import { GqlAuthGuard } from '../guard/gqlAuth.guard'

@Resolver(() => LiveTourModel)
export class LiveToursResolver {
Expand All @@ -22,21 +24,25 @@ export class LiveToursResolver {
}

@Mutation(() => LiveTourModel)
@UseGuards(GqlAuthGuard)
public async createLiveTour(@Args('input') input: CreateLiveTourInput) {
return this.liveToursService.create(input)
}

@Mutation(() => LiveTourModel)
@UseGuards(GqlAuthGuard)
public async updateLiveTourById(@Args('input') input: UpdateLiveTourInput) {
return this.liveToursService.update(input)
}

@Mutation(() => LiveTourModel)
@UseGuards(GqlAuthGuard)
public async deleteLiveTourById(@Args({ name: 'id', type: () => ID }) id: string) {
return this.liveToursService.deleteOneById(id)
}

@Mutation(() => BatchDeleteModel)
@UseGuards(GqlAuthGuard)
public async deleteLiveTours(@Args({ name: 'ids', type: () => [ID] }) ids: string[]) {
return this.liveToursService.batchDelete(ids)
}
Expand Down

0 comments on commit edd5d45

Please sign in to comment.