mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
finish segments, update migration from filters to parameters
This commit is contained in:
parent
8408bbd25c
commit
5ffafc71fc
10 changed files with 25 additions and 16 deletions
|
|
@ -33,7 +33,7 @@ export async function POST(
|
|||
const schema = z.object({
|
||||
type: segmentTypeParam,
|
||||
name: z.string().max(200),
|
||||
filters: z.object({}).passthrough(),
|
||||
parameters: z.object({}).passthrough(),
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
|
@ -43,7 +43,7 @@ export async function POST(
|
|||
}
|
||||
|
||||
const { websiteId, segmentId } = await params;
|
||||
const { type, name, filters } = body;
|
||||
const { type, name, parameters } = body;
|
||||
|
||||
const segment = await getSegment(segmentId);
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ export async function POST(
|
|||
const result = await updateSegment(segmentId, {
|
||||
type,
|
||||
name,
|
||||
filters,
|
||||
parameters,
|
||||
} as any);
|
||||
|
||||
return json(result);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export async function POST(
|
|||
const schema = z.object({
|
||||
type: segmentTypeParam,
|
||||
name: z.string().max(200),
|
||||
filters: z.object({}).passthrough(),
|
||||
parameters: z.object({}).passthrough(),
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
|
@ -49,7 +49,7 @@ export async function POST(
|
|||
}
|
||||
|
||||
const { websiteId } = await params;
|
||||
const { type, name, filters } = body;
|
||||
const { type, name, parameters } = body;
|
||||
|
||||
if (!(await canUpdateWebsite(auth, websiteId))) {
|
||||
return unauthorized();
|
||||
|
|
@ -60,7 +60,7 @@ export async function POST(
|
|||
websiteId,
|
||||
type,
|
||||
name,
|
||||
filters,
|
||||
parameters,
|
||||
} as any);
|
||||
|
||||
return json(result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue