Fixed funnel report saving invalid data.
Some checks are pending
Node.js CI / build (postgresql, 18.18) (push) Waiting to run

This commit is contained in:
Mike Cao 2025-09-22 22:03:26 -07:00
parent bf16ade184
commit 980e4e6b41
11 changed files with 34 additions and 25 deletions

View file

@ -2,8 +2,9 @@ import { z } from 'zod';
import * as send from '@/app/api/send/route';
import { parseRequest } from '@/lib/request';
import { json, serverError } from '@/lib/response';
import { anyObjectParam } from '@/lib/schema';
const schema = z.array(z.object({}).passthrough());
const schema = z.array(anyObjectParam);
export async function POST(request: Request) {
try {

View file

@ -1,7 +1,7 @@
import { canDeleteWebsite, canUpdateWebsite, canViewWebsite } from '@/permissions';
import { parseRequest } from '@/lib/request';
import { json, notFound, ok, unauthorized } from '@/lib/response';
import { segmentTypeParam } from '@/lib/schema';
import { anyObjectParam, segmentTypeParam } from '@/lib/schema';
import { deleteSegment, getSegment, updateSegment } from '@/queries';
import { z } from 'zod';
@ -33,7 +33,7 @@ export async function POST(
const schema = z.object({
type: segmentTypeParam,
name: z.string().max(200),
parameters: z.object({}).passthrough(),
parameters: anyObjectParam,
});
const { auth, body, error } = await parseRequest(request, schema);

View file

@ -2,7 +2,7 @@ import { canUpdateWebsite, canViewWebsite } from '@/permissions';
import { uuid } from '@/lib/crypto';
import { getQueryFilters, parseRequest } from '@/lib/request';
import { json, unauthorized } from '@/lib/response';
import { segmentTypeParam, searchParams } from '@/lib/schema';
import { segmentTypeParam, searchParams, anyObjectParam } from '@/lib/schema';
import { createSegment, getWebsiteSegments } from '@/queries';
import { z } from 'zod';
@ -42,7 +42,7 @@ export async function POST(
const schema = z.object({
type: segmentTypeParam,
name: z.string().max(200),
parameters: z.object({}).passthrough(),
parameters: anyObjectParam,
});
const { auth, body, error } = await parseRequest(request, schema);