mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Site Search Update
This commit is contained in:
@@ -3,14 +3,14 @@ import { Network } from "@/app/types";
|
||||
|
||||
const useNetworks = () => {
|
||||
|
||||
const addNetwork = (network: Network): Promise<string> | string => {
|
||||
const addNetwork = (network: Network): Promise<Network> | string => {
|
||||
if (!network.name) {
|
||||
return 'Network name is required';
|
||||
}
|
||||
|
||||
return axios.post('/api/sites/networks/add', network)
|
||||
.then(() => {
|
||||
return "Network added successfully";
|
||||
.then((response) => {
|
||||
return response.data.network;
|
||||
})
|
||||
.catch(err => {
|
||||
throw err.response?.data?.error || 'An error occurred';
|
||||
|
||||
Reference in New Issue
Block a user