Skip to content

Commit

Permalink
Update route.js
Browse files Browse the repository at this point in the history
  • Loading branch information
garimabhayanaa authored Oct 9, 2024
1 parent 3e43cb5 commit a9b6b85
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/app/api/ai/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,9 @@ export async function POST(req) {
console.log(data);
if (data.data.user) {
contributions = data.data.user.contributionsCollection; // Assign contributions globally
return NextResponse.json({
exists: true,
totalContributions: contributions.totalCommitContributions,
activeCodingDays: contributions.contributionCalendar.totalContributions
});
return contributions;
} else {
return NextResponse.json({ exists: false });
return null;
}
} catch (error) {
console.error("Error checking GitHub username:", error);
Expand Down

0 comments on commit a9b6b85

Please sign in to comment.