mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
add psql query for retention
This commit is contained in:
parent
ff5884237c
commit
13530c9cdc
5 changed files with 193 additions and 195 deletions
|
|
@ -7,17 +7,12 @@ import { getRetention } from 'queries';
|
|||
|
||||
export interface RetentionRequestBody {
|
||||
websiteId: string;
|
||||
urls: string[];
|
||||
window: number;
|
||||
dateRange: {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
};
|
||||
window: string;
|
||||
dateRange: { window; startDate: string; endDate: string };
|
||||
}
|
||||
|
||||
export interface RetentionResponse {
|
||||
urls: string[];
|
||||
window: number;
|
||||
window: string;
|
||||
startAt: number;
|
||||
endAt: number;
|
||||
}
|
||||
|
|
@ -32,7 +27,6 @@ export default async (
|
|||
if (req.method === 'POST') {
|
||||
const {
|
||||
websiteId,
|
||||
urls,
|
||||
window,
|
||||
dateRange: { startDate, endDate },
|
||||
} = req.body;
|
||||
|
|
@ -44,8 +38,7 @@ export default async (
|
|||
const data = await getRetention(websiteId, {
|
||||
startDate: new Date(startDate),
|
||||
endDate: new Date(endDate),
|
||||
urls,
|
||||
windowMinutes: +window,
|
||||
window: window,
|
||||
});
|
||||
|
||||
return ok(res, data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue