mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on API
This commit is contained in:
parent
d42712204c
commit
2431c3828b
@ -18,14 +18,27 @@ class ClientApiController extends \BaseController {
|
||||
{
|
||||
$clients = Client::scope()->get();
|
||||
|
||||
/*
|
||||
$response = [
|
||||
'status' => 200,
|
||||
'error' => false,
|
||||
'clients' => $clients->toArray()
|
||||
];
|
||||
*/
|
||||
|
||||
$response = json_encode($response, JSON_PRETTY_PRINT);
|
||||
$response = json_encode($clients->toArray(), JSON_PRETTY_PRINT);
|
||||
$headers = [
|
||||
'Content-Type' => 'application/json',
|
||||
'Access-Control-Allow-Origin' => '*',
|
||||
'Access-Control-Allow-Methods' => 'GET',
|
||||
//'Access-Control-Allow-Headers' => 'Origin, Content-Type, Accept, Authorization, X-Requested-With',
|
||||
//'Access-Control-Allow-Credentials' => 'true',
|
||||
//'X-Total-Count' => 0
|
||||
//'X-Rate-Limit-Limit' - The number of allowed requests in the current period
|
||||
//'X-Rate-Limit-Remaining' - The number of remaining requests in the current period
|
||||
//'X-Rate-Limit-Reset' - The number of seconds left in the current period,
|
||||
];
|
||||
|
||||
return Response::make($response, 200, ['Content-Type' => 'application/json']);
|
||||
return Response::make($response, 200, $headers);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user