import { index } from "../../cache/data";

export default (req, res) => {
  const results = index.filter(
    (e) =>
      e.title?.toLowerCase().includes(req.query.q) ||
      e?.slug.includes(req.query.q)
  );
  res.statusCode = 200;
  res.setHeader("Content-Type", "application/json");
  res.end(JSON.stringify({ results }));
};

@@ -159,16 +159,30 @@
 .query.q
+.toLowerCase()
 ) %7C%7C%0A   

fix case sensitivity in titles