mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-30 00:53:14 +00:00
Mock upload call
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import jsonServer from "json-server";
|
||||
import routes from "./mocks/routes.json" assert { type: "json" };
|
||||
import { v4 as uuid } from "uuid";
|
||||
|
||||
const server = jsonServer.create();
|
||||
const router = jsonServer.router("./src/mocks/db.json");
|
||||
@@ -11,6 +12,9 @@ server.use((req, res, next) => {
|
||||
if (req.method === "POST") {
|
||||
if (req.url.includes("/delete_conversation")) {
|
||||
req.method = "DELETE";
|
||||
} else if (req.url === "/upload") {
|
||||
const taskId = uuid();
|
||||
localStorage.setItem(taskId, true);
|
||||
}
|
||||
}
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user