Fixed funnel report saving invalid data.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user