mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Added back API route for quotes
This commit is contained in:
parent
80202b6d92
commit
1eb334f3b4
52
app/Http/Controllers/QuoteApiController.php
Normal file
52
app/Http/Controllers/QuoteApiController.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use Auth;
|
||||
use Input;
|
||||
use Utils;
|
||||
use Response;
|
||||
use App\Models\Invoice;
|
||||
use App\Ninja\Repositories\InvoiceRepository;
|
||||
use App\Http\Controllers\BaseAPIController;
|
||||
use App\Ninja\Transformers\QuoteTransformer;
|
||||
|
||||
class QuoteApiController extends BaseAPIController
|
||||
{
|
||||
protected $invoiceRepo;
|
||||
|
||||
protected $entityType = ENTITY_INVOICE;
|
||||
|
||||
public function __construct(InvoiceRepository $invoiceRepo)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->invoiceRepo = $invoiceRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @SWG\Get(
|
||||
* path="/quotes",
|
||||
* tags={"quote"},
|
||||
* summary="List of quotes",
|
||||
* @SWG\Response(
|
||||
* response=200,
|
||||
* description="A list with quotes",
|
||||
* @SWG\Schema(type="array", @SWG\Items(ref="#/definitions/Invoice"))
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* response="default",
|
||||
* description="an ""unexpected"" error"
|
||||
* )
|
||||
* )
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$invoices = Invoice::scope()
|
||||
->withTrashed()
|
||||
->where('is_quote', '=', '1')
|
||||
->with('invoice_items', 'client')
|
||||
->orderBy('created_at', 'desc');
|
||||
|
||||
return $this->listResponse($invoices);
|
||||
}
|
||||
|
||||
}
|
@ -251,8 +251,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'api/v1'], function()
|
||||
Route::get('accounts', 'AccountApiController@show');
|
||||
Route::put('accounts', 'AccountApiController@update');
|
||||
Route::resource('clients', 'ClientApiController');
|
||||
//Route::get('quotes', 'QuoteApiController@index');
|
||||
//Route::resource('quotes', 'QuoteApiController');
|
||||
Route::get('quotes', 'QuoteApiController@index');
|
||||
Route::get('invoices', 'InvoiceApiController@index');
|
||||
Route::get('download/{invoice_id}', 'InvoiceApiController@download');
|
||||
Route::resource('invoices', 'InvoiceApiController');
|
||||
|
Loading…
Reference in New Issue
Block a user