optimize endpoints, so re-use where possible

This commit is contained in:
proddy
2024-09-13 10:03:11 +02:00
parent 63a3152b91
commit 191edffe3c
23 changed files with 192 additions and 428 deletions

View File

@@ -8,7 +8,7 @@ import {
Typography
} from '@mui/material';
import { readHardwareStatus } from 'api/system';
import { readSystemStatus } from 'api/system';
import { dialogStyle } from 'CustomTheme';
import { useAutoRequest } from 'alova/client';
@@ -22,7 +22,7 @@ const RestartMonitor = () => {
let count = 0;
const { data } = useAutoRequest(readHardwareStatus, {
const { data } = useAutoRequest(readSystemStatus, {
pollingTime: 1000,
force: true,
initialData: { status: 'Getting ready...' },
@@ -38,7 +38,7 @@ const RestartMonitor = () => {
document.location.href = '/';
}
})
.onError((error, _method) => {
.onError((error) => {
setErrorMessage(error.message);
});