chore: prttier
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
import { default as axios } from "axios";
|
import { default as axios } from "axios";
|
||||||
|
|
||||||
export const sendProxyConfig = async (proxyConfig: {type: string, server: string, username:string, password: string}): Promise<boolean> => {
|
export const sendProxyConfig = async (proxyConfig: { type: string, server: string, username: string, password: string }): Promise<boolean> => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(`http://localhost:8080/proxy/config`, proxyConfig);
|
const response = await axios.post(`http://localhost:8080/proxy/config`, proxyConfig);
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
return response.data;
|
return response.data;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Failed to submit proxy configuration. Try again.`);
|
throw new Error(`Failed to submit proxy configuration. Try again.`);
|
||||||
}
|
}
|
||||||
} catch(error: any) {
|
} catch (error: any) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user