mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
finish clickhouse journeys query
This commit is contained in:
parent
3a6971e173
commit
0333bec986
8 changed files with 151 additions and 42 deletions
|
|
@ -27,7 +27,7 @@ const schema = {
|
|||
name: yup.string().max(200).required(),
|
||||
type: yup
|
||||
.string()
|
||||
.matches(/funnel|insights|retention|utm|goals/i)
|
||||
.matches(/funnel|insights|retention|utm|goals|journey/i)
|
||||
.required(),
|
||||
description: yup.string().max(500),
|
||||
parameters: yup
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ import * as yup from 'yup';
|
|||
export interface RetentionRequestBody {
|
||||
websiteId: string;
|
||||
dateRange: { startDate: string; endDate: string };
|
||||
steps: number;
|
||||
startStep?: string;
|
||||
endStep?: string;
|
||||
}
|
||||
|
||||
const schema = {
|
||||
|
|
@ -21,6 +24,9 @@ const schema = {
|
|||
endDate: yup.date().required(),
|
||||
})
|
||||
.required(),
|
||||
steps: yup.number().min(3).max(7).required(),
|
||||
startStep: yup.string(),
|
||||
endStep: yup.string(),
|
||||
}),
|
||||
};
|
||||
|
||||
|
|
@ -36,6 +42,9 @@ export default async (
|
|||
const {
|
||||
websiteId,
|
||||
dateRange: { startDate, endDate },
|
||||
steps,
|
||||
startStep,
|
||||
endStep,
|
||||
} = req.body;
|
||||
|
||||
if (!(await canViewWebsite(req.auth, websiteId))) {
|
||||
|
|
@ -45,6 +54,9 @@ export default async (
|
|||
const data = await getJourney(websiteId, {
|
||||
startDate: new Date(startDate),
|
||||
endDate: new Date(endDate),
|
||||
steps,
|
||||
startStep,
|
||||
endStep,
|
||||
});
|
||||
|
||||
return ok(res, data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue