mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Add timezone to report queries.
This commit is contained in:
parent
820ad69d60
commit
29a943df9c
7 changed files with 32 additions and 6 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { produce } from 'immer';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { useTimezone } from './useTimezone';
|
||||
import useApi from './useApi';
|
||||
|
||||
const baseParameters = {
|
||||
|
|
@ -12,6 +13,7 @@ export function useReport(reportId, defaultParameters) {
|
|||
const [report, setReport] = useState(null);
|
||||
const [isRunning, setIsRunning] = useState(false);
|
||||
const { get, post } = useApi();
|
||||
const [timezone] = useTimezone();
|
||||
|
||||
const loadReport = async id => {
|
||||
const data = await get(`/reports/${id}`);
|
||||
|
|
@ -33,7 +35,7 @@ export function useReport(reportId, defaultParameters) {
|
|||
|
||||
const { type } = report;
|
||||
|
||||
const data = await post(`/reports/${type}`, parameters);
|
||||
const data = await post(`/reports/${type}`, { ...parameters, timezone });
|
||||
|
||||
setReport(
|
||||
produce(state => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue