Fix website build (#3983)

This commit is contained in:
Charles Bochet
2024-02-14 21:28:26 +01:00
committed by GitHub
parent 62058dd0e9
commit 9777c5fbce
9 changed files with 71 additions and 49 deletions

View File

@ -1,3 +1,5 @@
export const dynamic = 'force-dynamic';
import { Metadata } from 'next';
import { Background } from '@/app/components/oss-friends/Background';

View File

@ -1,3 +1,6 @@
export const dynamic = 'force-dynamic';
import { global } from '@apollo/client/utilities/globals';
import { graphql } from '@octokit/graphql';
import { insertMany, migrate } from '@/database/database';
@ -86,7 +89,7 @@ interface RepoData {
const query = graphql.defaults({
headers: {
Authorization: 'bearer ' + process.env.GITHUB_TOKEN,
Authorization: 'bearer ' + global.process.env.GITHUB_TOKEN,
},
});
@ -196,6 +199,10 @@ async function fetchAssignableUsers(): Promise<Set<string>> {
}
export async function GET() {
if (!global.process.env.GITHUB_TOKEN) {
return new Response('No GitHub token provided', { status: 500 });
}
await migrate();
// TODO if we ever hit API Rate Limiting
@ -322,5 +329,7 @@ export async function GET() {
}
}
return new Response('Data synced', { status: 200 });
return new Response('Data synced', {
status: 200,
});
}

View File

@ -1,3 +1,5 @@
export const dynamic = 'force-dynamic';
import AvatarGrid from '@/app/components/AvatarGrid';
import { Header } from '@/app/components/developers/contributors/Header';
import { Background } from '@/app/components/oss-friends/Background';