diff --git a/bl-kernel/admin/themes/booty/index.php b/bl-kernel/admin/themes/booty/index.php index b86f3a6e..537d1c5a 100644 --- a/bl-kernel/admin/themes/booty/index.php +++ b/bl-kernel/admin/themes/booty/index.php @@ -78,7 +78,7 @@
diff --git a/bl-kernel/js/api.js b/bl-kernel/js/api.js index 09499145..88c5f057 100644 --- a/bl-kernel/js/api.js +++ b/bl-kernel/js/api.js @@ -22,8 +22,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -42,8 +43,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -68,8 +70,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -93,8 +96,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -113,8 +117,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -138,8 +143,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -163,8 +169,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -188,8 +195,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -213,8 +221,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -238,8 +247,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -263,8 +273,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -285,8 +296,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -310,8 +322,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -335,8 +348,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -360,8 +374,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -385,8 +400,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } @@ -410,8 +426,9 @@ class API { var json = await response.json(); return json; } catch (err) { + console.log(response); console.log(err); - return true; + return {'message': 'Error from API. Open the inspector from the browser for more details.'}; } } diff --git a/bl-kernel/js/variables.php b/bl-kernel/js/variables.php index 44c11f5d..5503fd4d 100644 --- a/bl-kernel/js/variables.php +++ b/bl-kernel/js/variables.php @@ -26,7 +26,7 @@ echo 'var tokenCSRF = "'.$security->getTokenCSRF().'";'.PHP_EOL; echo 'var UPLOAD_MAX_FILESIZE = '.Text::toBytes( ini_get('upload_max_filesize') ).';'.PHP_EOL; echo 'var DEBUG_MODE = '.(DEBUG_MODE?'true':'false').';'.PHP_EOL; echo 'var PASSWORD_LENGTH = '.PASSWORD_LENGTH.';'.PHP_EOL; -echo 'var api = new API("'.DOMAIN.'/api/", "'.$plugins['all']['pluginAPI']->token().'", "'.$login->tokenAuth().'", tokenCSRF);'.PHP_EOL; +echo 'var api = new API("'.DOMAIN_BASE.'api/", "'.$plugins['all']['pluginAPI']->token().'", "'.$login->tokenAuth().'", tokenCSRF);'.PHP_EOL; echo ''.PHP_EOL; ?> \ No newline at end of file