mirror of
https://github.com/Xevion/xevion.dev.git
synced 2025-12-06 05:17:10 -06:00
Remove keyed project route, log error
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user