mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Added error message component. Update fetch hook.
This commit is contained in:
parent
4cafa68e23
commit
ca8a6fe049
8 changed files with 50 additions and 11 deletions
|
|
@ -13,6 +13,7 @@ import usePageQuery from 'hooks/usePageQuery';
|
|||
import { getDateArray, getDateLength } from 'lib/date';
|
||||
import Times from 'assets/times.svg';
|
||||
import styles from './WebsiteChart.module.css';
|
||||
import ErrorMessage from '../common/ErrorMessage';
|
||||
|
||||
export default function WebsiteChart({
|
||||
websiteId,
|
||||
|
|
@ -31,7 +32,7 @@ export default function WebsiteChart({
|
|||
query: { url },
|
||||
} = usePageQuery();
|
||||
|
||||
const { data, loading } = useFetch(
|
||||
const { data, loading, error } = useFetch(
|
||||
`/api/website/${websiteId}/pageviews`,
|
||||
{
|
||||
start_at: +startDate,
|
||||
|
|
@ -83,6 +84,7 @@ export default function WebsiteChart({
|
|||
</div>
|
||||
<div className="row">
|
||||
<div className="col">
|
||||
{error && <ErrorMessage />}
|
||||
<PageviewsChart
|
||||
websiteId={websiteId}
|
||||
data={{ pageviews, uniques }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue