Move to a cental upload api

This commit is contained in:
Lee 2022-11-17 11:35:26 +00:00
parent 1d620e3ec0
commit a44ca7d8af
No known key found for this signature in database
GPG Key ID: 6EA25896ECCB3121

@ -1,8 +1,8 @@
import { StatusCodes } from "http-status-codes"; import { StatusCodes } from "http-status-codes";
import multer from "multer"; import multer from "multer";
import nextConnect from "next-connect"; import nextConnect from "next-connect";
import { createFile } from "../../../utils/helpers/fileHelpers"; import { createFile } from "../../utils/helpers/fileHelpers";
import { getUserByUploadKey } from "../../../utils/helpers/userHelpers"; import { getUserByUploadKey } from "../../utils/helpers/userHelpers";
const apiRoute = nextConnect({ const apiRoute = nextConnect({
onError(error, req, res) { onError(error, req, res) {
@ -23,7 +23,7 @@ apiRoute.use(
limits: { limits: {
fileSize: process.env.MAX_FILE_SIZE, fileSize: process.env.MAX_FILE_SIZE,
}, },
}).single("sharex") }).single("file")
); );
apiRoute.post(async (req, res) => { apiRoute.post(async (req, res) => {