mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
New standalone Journey page.
This commit is contained in:
parent
cee05d762c
commit
a167c590c5
16 changed files with 389 additions and 628 deletions
|
|
@ -1,19 +1,11 @@
|
|||
import { z } from 'zod';
|
||||
import { canViewWebsite } from '@/lib/auth';
|
||||
import { unauthorized, json } from '@/lib/response';
|
||||
import { parseRequest } from '@/lib/request';
|
||||
import { getJourney } from '@/queries';
|
||||
import { reportParms } from '@/lib/schema';
|
||||
import { reportResultSchema } from '@/lib/schema';
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const schema = z.object({
|
||||
...reportParms,
|
||||
steps: z.coerce.number().min(3).max(7),
|
||||
startStep: z.string().optional(),
|
||||
endStep: z.string().optional(),
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
const { auth, body, error } = await parseRequest(request, reportResultSchema);
|
||||
|
||||
if (error) {
|
||||
return error();
|
||||
|
|
@ -22,9 +14,7 @@ export async function POST(request: Request) {
|
|||
const {
|
||||
websiteId,
|
||||
dateRange: { startDate, endDate },
|
||||
steps,
|
||||
startStep,
|
||||
endStep,
|
||||
parameters: { steps, startStep, endStep },
|
||||
} = body;
|
||||
|
||||
if (!(await canViewWebsite(auth, websiteId))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue