import {IQueryHandler, QueryHandler} from "@nestjs/cqrs";
import {CheckIfAnotherVersusInProgressQuery} from "../check-if-another-versus-in-progress.query";
import {VersusService} from "../../versus/versus.service";

@QueryHandler(CheckIfAnotherVersusInProgressQuery)
export class CheckIfAnotherVersusInProgressHandler implements IQueryHandler<CheckIfAnotherVersusInProgressHandler> {
  constructor(private versusService: VersusService) {
  }
    async execute(query: CheckIfAnotherVersusInProgressHandler): Promise<any> {
        return await this.versusService.checkIfAnotherVersusInProgress();
    }

}