We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf24ba6 commit c1a0080Copy full SHA for c1a0080
src/api/forumAPI.ts
@@ -7,7 +7,10 @@ import { ForumTopic } from "../types/ForumWebhookTypes";
7
export async function getTopic(id: number): Promise<ForumTopic> {
8
const APIKEY: string | undefined = process.env.FORUM_API_KEY;
9
if (!APIKEY || !APIKEY.length) throw new Error('FORUM_API_KEY is not set in the environment variables.');
10
- const response = await fetch(`https://forums.nexusmods.com/api/forums/topics/${id}?key=${APIKEY}`, {
+ const params = new URLSearchParams({ key: APIKEY });
11
+ const forumsEndpoint = `https://forums.nexusmods.com/api/forums/topics/${id}?${params.toString()}`;
12
+
13
+ const response = await fetch(forumsEndpoint, {
14
method: 'GET',
15
headers: {
16
'Content-Type': 'application/json',
0 commit comments