mirror of
https://github.com/Xevion/xevion.dev.git
synced 2025-12-06 01:16:58 -06:00
Remove keyed project route, log error
This commit is contained in:
@@ -19,7 +19,7 @@ async function getURLs(
|
||||
return [];
|
||||
}
|
||||
|
||||
if (type === "project") return ["/projects", `/projects/${key}`];
|
||||
if (type === "project") return ["/projects"];
|
||||
if (type === "metadata") return ["/"];
|
||||
if (type === "technology") {
|
||||
const urls = ["/technology"];
|
||||
@@ -67,8 +67,10 @@ export default async function handler(
|
||||
try {
|
||||
// Verify JSON 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 });
|
||||
}
|
||||
|
||||
// Get URLs
|
||||
const urls = await getURLs(data.type, data.keys[0]!, data.payload);
|
||||
|
||||
Reference in New Issue
Block a user