diff --git a/src/plugins/reviewDB/auth.tsx b/src/plugins/reviewDB/auth.tsx index 136001b2d..4cd81f2ea 100644 --- a/src/plugins/reviewDB/auth.tsx +++ b/src/plugins/reviewDB/auth.tsx @@ -59,7 +59,7 @@ export function authorize(callback?: any) { const url = new URL(response.location); url.searchParams.append("clientMod", "vencord"); const res = await fetch(url, { - headers: new Headers({ Accept: "application/json" }) + headers: { Accept: "application/json" } }); if (!res.ok) { diff --git a/src/plugins/reviewDB/reviewDbApi.ts b/src/plugins/reviewDB/reviewDbApi.ts index ec6d9ff3b..3fe6dd061 100644 --- a/src/plugins/reviewDB/reviewDbApi.ts +++ b/src/plugins/reviewDB/reviewDbApi.ts @@ -118,10 +118,10 @@ export async function addReview(review: any): Promise { export async function deleteReview(id: number): Promise { return await rdbRequest(`/users/${id}/reviews`, { method: "DELETE", - headers: new Headers({ + headers: { "Content-Type": "application/json", Accept: "application/json", - }), + }, body: JSON.stringify({ reviewid: id }) @@ -135,10 +135,10 @@ export async function deleteReview(id: number): Promise { export async function reportReview(id: number) { const res = await rdbRequest("/reports", { method: "PUT", - headers: new Headers({ + headers: { "Content-Type": "application/json", Accept: "application/json", - }), + }, body: JSON.stringify({ reviewid: id, }) @@ -150,10 +150,10 @@ export async function reportReview(id: number) { async function patchBlock(action: "block" | "unblock", userId: string) { const res = await rdbRequest("/blocks", { method: "PATCH", - headers: new Headers({ + headers: { "Content-Type": "application/json", Accept: "application/json", - }), + }, body: JSON.stringify({ action: action, discordId: userId @@ -180,9 +180,9 @@ export const unblockUser = (userId: string) => patchBlock("unblock", userId); export async function fetchBlocks(): Promise { const res = await rdbRequest("/blocks", { method: "GET", - headers: new Headers({ + headers: { Accept: "application/json", - }) + } }); if (!res.ok) throw new Error(`${res.status}: ${res.statusText}`);