mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Filter tag enhancements.
This commit is contained in:
parent
a4d8afe516
commit
ef11124672
12 changed files with 160 additions and 64 deletions
|
|
@ -1,13 +1,7 @@
|
|||
import { NextApiRequest } from 'next';
|
||||
import { getAllowedUnits, getMinimumUnit } from './date';
|
||||
import { getWebsiteDateRange } from '../queries';
|
||||
import { FILTER_COLUMNS, OPERATORS } from 'lib/constants';
|
||||
|
||||
const OPERATOR_SYMBOLS = {
|
||||
'!': 'neq',
|
||||
'~': 'c',
|
||||
'!~': 'dnc',
|
||||
};
|
||||
import { FILTER_COLUMNS, OPERATORS, OPERATOR_PREFIXES } from 'lib/constants';
|
||||
|
||||
export async function parseDateRangeQuery(req: NextApiRequest) {
|
||||
const { websiteId, startAt, endAt, unit } = req.query;
|
||||
|
|
@ -52,7 +46,7 @@ export function getQueryFilters(req: NextApiRequest) {
|
|||
obj[key] = {
|
||||
name: key,
|
||||
column: FILTER_COLUMNS[key],
|
||||
operator: OPERATOR_SYMBOLS[prefix] || OPERATORS.equals,
|
||||
operator: OPERATOR_PREFIXES[prefix] || OPERATORS.equals,
|
||||
value: paramValue,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue