mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
Refactor part 2: Electric Boogaloo. Standardize way of passing filter parameters.
This commit is contained in:
parent
f26f1b0581
commit
cdf391d5c2
90 changed files with 867 additions and 709 deletions
|
|
@ -41,19 +41,20 @@ export interface QueryOptions {
|
|||
joinSession?: boolean;
|
||||
columns?: Record<string, string>;
|
||||
limit?: number;
|
||||
prefix?: string;
|
||||
}
|
||||
|
||||
export interface QueryFilters {
|
||||
websiteId?: string;
|
||||
// Date range
|
||||
export interface QueryFilters extends DateParams, FilterParams, SortParams, PageParams {}
|
||||
|
||||
export interface DateParams {
|
||||
startDate?: Date;
|
||||
endDate?: Date;
|
||||
compareStartDate?: Date;
|
||||
compareEndDate?: Date;
|
||||
compare?: string;
|
||||
unit?: string;
|
||||
timezone?: string;
|
||||
// Filters
|
||||
compareDate?: Date;
|
||||
}
|
||||
|
||||
export interface FilterParams {
|
||||
path?: string;
|
||||
referrer?: string;
|
||||
title?: string;
|
||||
|
|
@ -70,20 +71,16 @@ export interface QueryFilters {
|
|||
search?: string;
|
||||
tag?: string;
|
||||
eventType?: number;
|
||||
// Paging
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
// Sorting
|
||||
}
|
||||
|
||||
export interface SortParams {
|
||||
orderBy?: string;
|
||||
sortDescending?: boolean;
|
||||
}
|
||||
|
||||
export interface PageParams {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
orderBy?: string;
|
||||
sortDescending?: boolean;
|
||||
search?: string;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface PageResult<T> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue