Use Record, not Map

This commit is contained in:
2024-12-19 17:34:17 -06:00
parent faf3b8d28f
commit b8b6f3b228

View File

@@ -7,7 +7,7 @@ import { env } from "@/env/server.mjs";
async function getURLs( async function getURLs(
type: string, type: string,
key: string | number, key: string | number,
payload: Map<string, unknown>, payload: Record<string, unknown>,
): Promise<string[] | null> { ): Promise<string[] | null> {
if (type == "project_link" || type == "project_technology") { if (type == "project_link" || type == "project_technology") {
console.error({ console.error({
@@ -50,8 +50,8 @@ async function getURLs(
const requestSchema = z.object({ const requestSchema = z.object({
type: z.string(), type: z.string(),
keys: z.array(z.string().or(z.number().int())).min(1), keys: z.array(z.string().or(z.number().int())).min(1),
source: z.map(z.string(), z.any()), source: z.record(z.string(), z.any()),
payload: z.map(z.string(), z.any()), payload: z.record(z.string(), z.any()),
}); });
export default async function handler( export default async function handler(