feat: configured authentification
This commit is contained in:
@ -1,26 +0,0 @@
|
||||
import axios from "axios";
|
||||
|
||||
const backendUrl = "http://localhost:8080/"
|
||||
|
||||
// TODO: spawn a error modal
|
||||
function defaultApiErrorHandler(err: String){
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
function defaultApiSuccessHandler(response: () => void){
|
||||
console.log(response)
|
||||
}
|
||||
/*
|
||||
function callApi(endpoint: string, onSuccessHandler: () => void, onErrorHandler: (err: String) => void): void {
|
||||
console.log("callApi: "+ endpoint)
|
||||
axios.get(backendUrl + endpoint).then(
|
||||
onSuccessHandler == null ? defaultApiSuccessHandler : onSuccessHandler
|
||||
).catch(
|
||||
(err) => {
|
||||
onErrorHandler == null ? defaultApiErrorHandler(err): onErrorHandler(err);
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export {callApi}
|
||||
*/
|
Reference in New Issue
Block a user