mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(console): fix dashboard date (#1274)
This commit is contained in:
parent
7871293e12
commit
8c0ceff574
1 changed files with 2 additions and 2 deletions
|
@ -30,6 +30,7 @@ const tickStyle = {
|
|||
};
|
||||
|
||||
const Dashboard = () => {
|
||||
const [date, setDate] = useState<string>(dayjs().format('YYYY-MM-DD'));
|
||||
const { data: totalData, error: totalError } = useSWR<TotalUsersResponse, RequestError>(
|
||||
'/api/dashboard/users/total'
|
||||
);
|
||||
|
@ -37,10 +38,9 @@ const Dashboard = () => {
|
|||
'/api/dashboard/users/new'
|
||||
);
|
||||
const { data: activeData, error: activeError } = useSWR<ActiveUsersResponse, RequestError>(
|
||||
'/api/dashboard/users/active'
|
||||
`/api/dashboard/users/active?date=${date}`
|
||||
);
|
||||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
||||
const [date, setDate] = useState<string>(dayjs().format('YYYY-MM-DD'));
|
||||
|
||||
// Pick an error as the page's error
|
||||
const error = totalError ?? newError ?? activeError;
|
||||
|
|
Loading…
Reference in a new issue