mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Merge pull request #893 from turbo124/develop
Stubs for DocumentAPIController
This commit is contained in:
commit
33e59a2af9
@ -166,12 +166,12 @@ class DashboardApiController extends BaseAPIController
|
||||
|
||||
$data = [
|
||||
'id' => 1,
|
||||
'paidToDate' => $paidToDate[0]->value,
|
||||
'paidToDateCurrency' => $paidToDate[0]->currency_id,
|
||||
'balances' => $balances[0]->value,
|
||||
'balancesCurrency' => $balances[0]->currency_id,
|
||||
'averageInvoice' => $averageInvoice[0]->invoice_avg,
|
||||
'averageInvoiceCurrency' => $averageInvoice[0]->currency_id,
|
||||
'paidToDate' => $paidToDate[0]->value ? $paidToDate[0]->value : 0,
|
||||
'paidToDateCurrency' => $paidToDate[0]->currency_id ? $paidToDate[0]->currency_id : 0,
|
||||
'balances' => $balances[0]->value ? $balances[0]->value : 0,
|
||||
'balancesCurrency' => $balances[0]->currency_id ? $balances[0]->currency_id : 0,
|
||||
'averageInvoice' => $averageInvoice[0]->invoice_avg ? $averageInvoice[0]->invoice_avg : 0,
|
||||
'averageInvoiceCurrency' => $averageInvoice[0]->currency_id ? $averageInvoice[0]->currency_id : 0,
|
||||
'invoicesSent' => $metrics ? $metrics->invoices_sent : 0,
|
||||
'activeClients' => $metrics ? $metrics->active_clients : 0,
|
||||
];
|
||||
|
40
app/Http/Controllers/DocumentAPIController.php
Normal file
40
app/Http/Controllers/DocumentAPIController.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Document;
|
||||
|
||||
class DocumentAPIController extends BaseAPIController
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
//stub
|
||||
}
|
||||
|
||||
public function show($publicId)
|
||||
{
|
||||
$document = Document::scope($publicId)->firstOrFail();
|
||||
|
||||
return DocumentController::getDownloadResponse($document);
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
//stub
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
//stub
|
||||
}
|
||||
|
||||
public function destroy($publicId)
|
||||
{
|
||||
//stub
|
||||
}
|
||||
}
|
@ -284,6 +284,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'api/v1'], function()
|
||||
Route::post('add_token', 'AccountApiController@addDeviceToken');
|
||||
Route::post('update_notifications', 'AccountApiController@updatePushNotifications');
|
||||
Route::get('dashboard', 'DashboardApiController@index');
|
||||
Route::resource('documents', 'DocumentAPIController');
|
||||
|
||||
// Vendor
|
||||
Route::resource('vendors', 'VendorApiController');
|
||||
|
Loading…
Reference in New Issue
Block a user