Commit 088544f
authored
fix: fetch versus calendar outside org branch — versus param silently ignored when org is set (JhaSourav07#2213)
Fixes JhaSourav07#2192
## Description
In `app/api/streak/route.ts`, the `versus` calendar was only fetched
inside the `else` branch (single user mode). When the `org` param was
also set, the `versus` fetch was skipped entirely — `versusCalendar`
remained `undefined`, the `else if (versus && versusCalendar)` condition
was never true, and the response silently fell through to a normal
single-user SVG with no error.
Fixed by moving the `versus` fetch outside the `if (org) / else` block
so it runs independently for both user and org modes.
## Pillar
- [x] 🛠️ Other (Bug fix, refactoring, docs)
## Visual Preview
N/A — API fix, no UI change.
## Checklist before requesting a review:
- [x] I have read the `CONTRIBUTING.md` file.
- [x] I have tested these changes locally
(`localhost:3000/api/streak?user=YOUR_USERNAME`).
- [x] I have run `npm run format` and `npm run lint` locally and
resolved all errors.
- [x] My commits follow the Conventional Commits format.
- [ ] I have updated `README.md` if I added a new theme or URL
parameter.
- [x] I have starred the repo.
- [x] I have made sure that I have only one commit to merge in this PR.
- [x] The SVG output matches the CommitPulse "premium quality" aesthetic
standard.
- [ ] (Recommended) I joined the CommitPulse Discord community.1 file changed
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
192 | 193 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
| |||
0 commit comments