fix(api): data not defined

This commit is contained in:
diced 2022-02-21 09:28:32 -08:00
parent 42d77e445b
commit 4d9a22e82c
No known key found for this signature in database
GPG key ID: 85AB64C74535D76E

View file

@ -91,6 +91,9 @@ async function run() {
res.end(data);
}
} else if (req.url.startsWith(config.uploader.route)) {
const data = await getFile(config.uploader.directory, parts[2]);
if (!data) return app.render404(req, res);
let image = await prisma.image.findFirst({
where: {
OR: [