Skip to content

Commit c1047cf

Browse files
committed
fix: fetch versus calendar outside org branch — versus param no longer silently ignored when org is set
- versusCalendar was only fetched inside the else branch - When org param was set, versus was silently dropped - Move versus fetch outside if/else so it runs for both user and org modes
1 parent 8ed21bb commit c1047cf

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

app/api/streak/route.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,16 @@ export async function GET(request: Request) {
183183
to,
184184
});
185185
calendar = userData.calendar;
186+
}
186187

187-
if (versus) {
188-
const versusData = await fetchGitHubContributions(versus, {
189-
bypassCache: refresh,
190-
from,
191-
to,
192-
});
193-
versusCalendar = versusData.calendar;
194-
}
188+
// Fetch versus calendar independently — works with both user and org modes
189+
if (versus) {
190+
const versusData = await fetchGitHubContributions(versus, {
191+
bypassCache: refresh,
192+
from,
193+
to,
194+
});
195+
versusCalendar = versusData.calendar;
195196
}
196197

197198
let svg = '';

0 commit comments

Comments
 (0)