Remove keyed project route, log error

This commit is contained in:
2024-12-28 20:05:05 -06:00
parent 47e664b313
commit fe3d2aefbe

View File

@@ -19,7 +19,7 @@ async function getURLs(
return []; return [];
} }
if (type === "project") return ["/projects", `/projects/${key}`]; if (type === "project") return ["/projects"];
if (type === "metadata") return ["/"]; if (type === "metadata") return ["/"];
if (type === "technology") { if (type === "technology") {
const urls = ["/technology"]; const urls = ["/technology"];
@@ -67,8 +67,10 @@ export default async function handler(
try { try {
// Verify JSON body // Verify JSON body
const { success, data, error } = requestSchema.safeParse(req.body); const { success, data, error } = requestSchema.safeParse(req.body);
if (!success) if (!success) {
console.error({ message: "Invalid JSON body", error });
return res.status(400).json({ message: "Invalid JSON body", error }); return res.status(400).json({ message: "Invalid JSON body", error });
}
// Get URLs // Get URLs
const urls = await getURLs(data.type, data.keys[0]!, data.payload); const urls = await getURLs(data.type, data.keys[0]!, data.payload);