Update index.js
Browse files
index.js
CHANGED
@@ -95,7 +95,9 @@ app.post("/api/v1/fluxai-ai", async (req, res) => {
|
|
95 |
try {
|
96 |
const query = req.body.query;
|
97 |
const imageBytes = await schellwithflux(query);
|
98 |
-
|
|
|
|
|
99 |
if (!imageBytes) {
|
100 |
return res.status(500).json({ error: "Failed to fetch image bytes" });
|
101 |
}
|
|
|
95 |
try {
|
96 |
const query = req.body.query;
|
97 |
const imageBytes = await schellwithflux(query);
|
98 |
+
if (!query) {
|
99 |
+
return res.status(400).send('Query parameter is missing');
|
100 |
+
}
|
101 |
if (!imageBytes) {
|
102 |
return res.status(500).json({ error: "Failed to fetch image bytes" });
|
103 |
}
|