mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
try with application/json
This commit is contained in:
parent
b018ae894b
commit
32eeda69b2
@ -23,6 +23,9 @@ export const apiGet = async (url: string): Promise<any> => {
|
||||
return axios
|
||||
.get(url)
|
||||
.then((result) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('IN apiGet.THEN: ' + JSON.stringify({ success: true, result: result }))
|
||||
|
||||
if (result.status !== 200) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('IN status: ' + 'HTTP Status Error ' + result.status)
|
||||
@ -33,8 +36,6 @@ export const apiGet = async (url: string): Promise<any> => {
|
||||
console.log('IN state: ' + result.data.state + ' message: ' + result.data.msg)
|
||||
throw new Error(result.data.msg)
|
||||
}
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('IN apiGet.THEN: ' + JSON.stringify({ success: true, result: result }))
|
||||
return { success: true, result: result }
|
||||
})
|
||||
.catch((error) => {
|
||||
|
||||
@ -271,6 +271,8 @@ class AppRequestsController extends AppController
|
||||
public function getBalance($session_id = 0)
|
||||
{
|
||||
$this->viewBuilder()->setLayout('ajax');
|
||||
$this->response = $this->response->withType('application/json');
|
||||
|
||||
$login_result = $this->requestLogin($session_id, false);
|
||||
if($login_result !== true) {
|
||||
$this->set('body', $login_result);
|
||||
@ -301,12 +303,16 @@ class AppRequestsController extends AppController
|
||||
}
|
||||
|
||||
$body['decay_date'] = $now;
|
||||
$this->addAdminError("AppRequests", "getBalance", $body, $user['id']);
|
||||
$this->set('body', $body);
|
||||
}
|
||||
|
||||
public function listTransactions($page = 1, $count = 25, $orderDirection = 'ASC', $session_id = 0)
|
||||
{
|
||||
|
||||
$this->viewBuilder()->setLayout('ajax');
|
||||
$this->response = $this->response->withType('application/json');
|
||||
|
||||
$startTime = microtime(true);
|
||||
|
||||
$login_result = $this->requestLogin($session_id, false);
|
||||
|
||||
@ -6,6 +6,10 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
$body['balance'] = $this->element('centToFloat', ['cent' => $body['balance'], 'precision' => 4]);
|
||||
$body['decay'] = $this->element('centToFloat', ['cent' => $body['decay'], 'precision' => 4]);
|
||||
if(isset($body['balance'])) {
|
||||
$body['balance'] = $this->element('centToFloat', ['cent' => $body['balance'], 'precision' => 4]);
|
||||
}
|
||||
if(isset($body['decay'])) {
|
||||
$body['decay'] = $this->element('centToFloat', ['cent' => $body['decay'], 'precision' => 4]);
|
||||
}
|
||||
?><?= json_encode($body) ?>
|
||||
Loading…
x
Reference in New Issue
Block a user