fix: use zod issues instead of errors for build compatibility

This commit is contained in:
Carlos (Almeira) 2026-03-28 09:53:10 -05:00
parent dda9ae0f4a
commit ea551469b7
2 changed files with 3 additions and 3 deletions

View File

@ -111,7 +111,7 @@ export async function POST(request: NextRequest) {
const parseResult = PostSchema.safeParse(body);
if (!parseResult.success) {
const errors: Record<string, string[]> = {};
parseResult.error.errors.forEach((err) => {
parseResult.error.issues.forEach((err) => {
const key = String(err.path[0]);
if (!errors[key]) errors[key] = [];
errors[key].push(err.message);
@ -166,7 +166,7 @@ export async function PUT(request: NextRequest) {
const parseResult = PostPatchSchema.safeParse(body);
if (!parseResult.success) {
const errors: Record<string, string[]> = {};
parseResult.error.errors.forEach((err) => {
parseResult.error.issues.forEach((err) => {
const key = String(err.path[0]);
if (!errors[key]) errors[key] = [];
errors[key].push(err.message);

View File

@ -121,7 +121,7 @@ export const PublicationLayout: React.FC<PublicationLayoutProps> = ({
const parseResult = PostSchema.safeParse(Object.fromEntries(formData.entries()));
if (!parseResult.success) {
const errors: Record<string, string> = {};
parseResult.error.errors.forEach((err) => {
parseResult.error.issues.forEach((err) => {
const field = err.path[0] as string;
errors[field] = err.message;
});