randydev commited on
Commit
98b8079
·
verified ·
1 Parent(s): fa3c558

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +3 -1
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
  }