fix rest api, need to change every variable to readable

This commit is contained in:
Ibnu Maksum
2024-04-01 13:01:21 +07:00
parent ee73621c85
commit 254fd4ccf7
4 changed files with 26 additions and 16 deletions

View File

@ -73,8 +73,11 @@ ORM::configure('return_result_sets', true);
if ($_app_stage != 'Live') {
ORM::configure('logging', true);
}
define('U', APP_URL . '/index.php?_route=');
if($isApi){
define('U', APP_URL . '/system/api.php?r=');
}else{
define('U', APP_URL . '/index.php?_route=');
}
// notification message
if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . "notifications.json")) {
@ -224,8 +227,10 @@ function alphanumeric($str, $tambahan = "")
function showResult($success, $message = '', $result = [], $meta = [])
{
header("Content-Type: Application/json; charset=utf-8");
die(json_encode(array('success' => $success, 'message' => $message, 'result' => $result, 'meta' => $meta)));
header("Content-Type: Application/json");
$json = json_encode(['success' => $success, 'message' => $message, 'result' => $result, 'meta' => $meta]);
echo $json;
die();
}
function sendTelegram($txt)