Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit f1b3d69

Browse files
committed
fix: use node-fetch
1 parent 65e234e commit f1b3d69

File tree

5 files changed

+3
-15
lines changed

5 files changed

+3
-15
lines changed

next.config.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,6 @@ const nextConfig = {
1313
},
1414

1515
webpack: (config, options) => {
16-
if (options.isServer) {
17-
const originalEntry = config.entry;
18-
config.entry = async () => {
19-
const entries = await originalEntry();
20-
if (entries["pages/_app"]) {
21-
entries["pages/_app"].unshift("./src/fuck-the-fetch.ts");
22-
}
23-
return entries;
24-
};
25-
}
26-
2716
config.module.rules.push({
2817
test: /\.yml/,
2918
use: "yaml-loader",

src/api/chat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { RequestGetChats, RequestSend, ResponseGetChats, ResponseSend } from "@/pages/api/chatgpt/chat";
2+
import fetch from "node-fetch";
23

34
export async function getChatsByConversationId(conversationId: number) {
45
const response = await fetch("/api/chatgpt/chat", {

src/api/conversation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import fetch from "node-fetch";
12
import {
23
RequestChangeConversationName,
34
RequestCreateConversation,

src/api/user.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import fetch from "node-fetch";
12
import { SITE_INTERNAL_HEADER_URL } from "@/configs/constants";
23

34
export async function logout() {

src/fuck-the-fetch.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)