mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
Added useFilterQuery. Converted websites and reports pages.
This commit is contained in:
parent
6846355c63
commit
7e626dcd52
29 changed files with 373 additions and 499 deletions
|
|
@ -1,13 +1,13 @@
|
|||
import { uuid } from 'lib/crypto';
|
||||
import { useAuth, useCors, useValidate } from 'lib/middleware';
|
||||
import { NextApiRequestQueryBody, ReportSearchFilterType, SearchFilter } from 'lib/types';
|
||||
import { NextApiRequestQueryBody, SearchFilter } from 'lib/types';
|
||||
import { pageInfo } from 'lib/schema';
|
||||
import { NextApiResponse } from 'next';
|
||||
import { methodNotAllowed, ok } from 'next-basics';
|
||||
import { createReport, getReportsByUserId } from 'queries';
|
||||
import * as yup from 'yup';
|
||||
|
||||
export interface ReportsRequestQuery extends SearchFilter<ReportSearchFilterType> {}
|
||||
export interface ReportsRequestQuery extends SearchFilter {}
|
||||
|
||||
export interface ReportRequestBody {
|
||||
websiteId: string;
|
||||
|
|
@ -52,12 +52,11 @@ export default async (
|
|||
} = req.auth;
|
||||
|
||||
if (req.method === 'GET') {
|
||||
const { page, filter, pageSize } = req.query;
|
||||
const { page, query } = req.query;
|
||||
|
||||
const data = await getReportsByUserId(userId, {
|
||||
page,
|
||||
filter,
|
||||
pageSize: +pageSize || undefined,
|
||||
query,
|
||||
includeTeams: true,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue