mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Bug Fixes
This commit is contained in:
@@ -33,7 +33,7 @@ const useNetworks = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const deleteNetwork = (networkId: string): Promise<string> | string => {
|
||||
const deleteNetwork = (networkId: number): Promise<string> | string => {
|
||||
if (!networkId) {
|
||||
return 'Network ID is required';
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ const useSite = () => {
|
||||
description: "",
|
||||
networks: []
|
||||
});
|
||||
const [siteId, setSiteId] = useState("");
|
||||
const [siteId, setSiteId] = useState<number>(0);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const [itemPerPage, setItemPerPage] = useState(() => {
|
||||
@@ -22,10 +22,11 @@ const useSite = () => {
|
||||
const [sites, setSites] = useState([]);
|
||||
|
||||
const loadSite = useCallback(() => {
|
||||
console.log(siteId)
|
||||
if (!siteId) return;
|
||||
setLoading(true);
|
||||
axios.get('/api/sites/get', {
|
||||
params: { siteId }
|
||||
params: { siteId: siteId }
|
||||
}).then((response) => {
|
||||
setSite(response.data.site);
|
||||
setLoading(false);
|
||||
@@ -35,7 +36,7 @@ const useSite = () => {
|
||||
const updateSite = useCallback(() => {
|
||||
if (!siteId) return;
|
||||
axios.get('/api/sites/get', {
|
||||
params: { siteId }
|
||||
params: { siteId: siteId }
|
||||
}).then((response) => {
|
||||
setSite(response.data.site);
|
||||
});
|
||||
@@ -77,12 +78,12 @@ const useSite = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const deleteSite = (siteId: string) => {
|
||||
const deleteSite = (siteId: number) => {
|
||||
axios.delete('/api/sites/delete', {
|
||||
params: { siteId }
|
||||
params: { siteId: siteId }
|
||||
})
|
||||
.then(() => {
|
||||
setSiteId('');
|
||||
setSiteId(0);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
|
||||
Reference in New Issue
Block a user