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

feat: enchanced votes with turn for polls #224

Merged
merged 12 commits into from
Jul 11, 2024
Merged

Conversation

userMeh
Copy link
Contributor

@userMeh userMeh commented Jul 5, 2024

Summary 📝

Adds turns and stop conditions for all polls

Which part of the repository is impacted ?

  • API
  • Client
  • Admin
  • Documentation
  • CI/CD
  • Other

Test plan 🧪

Screenshots (if appropriate): 📸

@github-actions github-actions bot added the enhancement New feature or request label Jul 5, 2024
@Jayllyz Jayllyz linked an issue Jul 6, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Jul 8, 2024

Coverage Report for API (./apps/api)

Status Category Percentage Covered / Total
🟢 Lines 88.95% (🎯 80%) 6661 / 7488
🟢 Statements 88.95% (🎯 80%) 6661 / 7488
🟢 Functions 79.16% (🎯 60%) 19 / 24
🟢 Branches 46.38% (🎯 35%) 263 / 567
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
apps/api/src/handlers/votes.ts 69.66% 46.66% 100% 69.66% 27-28, 32-34, 36-39, 41-42, 44-48, 50, 52-55, 57-58, 73-74, 84-85, 94-95, 103-104, 120-121, 142-143, 152-153, 157-158, 171-172, 194-195, 216-217, 227-235, 237-240, 253-254, 281-282, 297-298, 313-314, 328-329, 336-337, 340-341, 344-348, 350-352, 354-356, 358-361, 369-370, 378-379
apps/api/src/libs/votes.ts 40.81% 50% 100% 40.81% 28-29, 35-41, 57-62, 64-69, 71-76, 78-79
apps/api/src/routes/votes.ts 100% 100% 100% 100%
Generated in workflow #412

const format = data.map((poll) => ({
...poll,
results: poll.results.map((option) => ({ ...option, votes: option.votes.length })),
}));

const subFormat = subData.map((poll) => ({
Copy link
Contributor

@Jayllyz Jayllyz Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je pense qu'il faudrait mettre cette partie du code sous forme de fonction pour pouvoir l'utiliser à la fois dans getOnePoll et getAllPolls, en cas de modif ca évite d'oublier de changer les 2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est pas pratique de l'exporter en fonction parce que le type de "poll" c'est un type différent de ceux déclaré et ducoup faudrait faire un autre type juste pour lui

@userMeh userMeh marked this pull request as ready for review July 11, 2024 09:59
@userMeh userMeh changed the title feat: updated route for more votes turn feat: enchanced votes with turn for polls Jul 11, 2024
@userMeh userMeh merged commit 9602085 into main Jul 11, 2024
7 checks passed
@userMeh userMeh deleted the admin/feat/enhanced-votes branch July 11, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: polls improvement
2 participants