mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
Convert /api/users.
This commit is contained in:
parent
090abcff81
commit
baa3851fb4
61 changed files with 1064 additions and 70 deletions
|
|
@ -5,7 +5,13 @@ import prisma from 'lib/prisma';
|
|||
import { QueryFilters } from 'lib/types';
|
||||
|
||||
export async function getSessionMetrics(
|
||||
...args: [websiteId: string, type: string, filters: QueryFilters, limit?: number, offset?: number]
|
||||
...args: [
|
||||
websiteId: string,
|
||||
type: string,
|
||||
filters: QueryFilters,
|
||||
limit?: number | string,
|
||||
offset?: number | string,
|
||||
]
|
||||
) {
|
||||
return runQuery({
|
||||
[PRISMA]: () => relationalQuery(...args),
|
||||
|
|
@ -17,8 +23,8 @@ async function relationalQuery(
|
|||
websiteId: string,
|
||||
type: string,
|
||||
filters: QueryFilters,
|
||||
limit: number = 500,
|
||||
offset: number = 0,
|
||||
limit: number | string = 500,
|
||||
offset: number | string = 0,
|
||||
) {
|
||||
const column = FILTER_COLUMNS[type] || type;
|
||||
const { parseFilters, rawQuery } = prisma;
|
||||
|
|
@ -60,8 +66,8 @@ async function clickhouseQuery(
|
|||
websiteId: string,
|
||||
type: string,
|
||||
filters: QueryFilters,
|
||||
limit: number = 500,
|
||||
offset: number = 0,
|
||||
limit: number | string = 500,
|
||||
offset: number | string = 0,
|
||||
): Promise<{ x: string; y: number }[]> {
|
||||
const column = FILTER_COLUMNS[type] || type;
|
||||
const { parseFilters, rawQuery } = clickhouse;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue