Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get.currentStage(), get.currentRound() and helpers.isRoundCompleted() #147

Merged
merged 3 commits into from
Oct 31, 2022

Conversation

Drarig29
Copy link
Owner

@Drarig29 Drarig29 commented Oct 31, 2022

This PR aims to help users handle the following scenarios:

  • Get all the matches in the current round:

    const tournamentId = 3;
    const currentStage = await manager.get.currentStage(tournamentId);
    const currentRound = await manager.get.currentRound(currentStage.id);
    // or
    const stageId = 5;
    const currentRound = await manager.get.currentRound(stageId);
    
    const currentRoundMatches = await manager.storage.select('match', { round_id: currentRound.id });
  • Know if a round is finished or not:

    const { helpers } = require('brackets-manager')
    const roundMatches = await manager.storage.select('match', { round_id: 3 });
    const isFinished = helpers.isRoundCompleted(roundMatches);

@Drarig29 Drarig29 merged commit a83780e into master Oct 31, 2022
@Drarig29 Drarig29 mentioned this pull request Oct 31, 2022
@Drarig29 Drarig29 deleted the corentin.girard/new-functions branch June 22, 2023 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant