mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
api bug fixes
This commit is contained in:
parent
7d2f635272
commit
b3346011bc
@ -91,12 +91,14 @@ class PaymentApiController extends BaseAPIController
|
||||
{
|
||||
$data = Input::all();
|
||||
$data['public_id'] = $publicId;
|
||||
$invoice = Invoice::scope($data['invoice_id'])->with('client')->first();
|
||||
|
||||
$error = false;
|
||||
$payment = $this->paymentRepo->save($data);
|
||||
if ($error) {
|
||||
return $error;
|
||||
}
|
||||
$invoice = Invoice::scope($payment->invoice_id)->with('client', 'invoice_items', 'invitations')->first();
|
||||
$invoice = Invoice::scope($invoice->public_id)->with('client', 'invoice_items', 'invitations')->first();
|
||||
$transformer = new InvoiceTransformer(\Auth::user()->account, Input::get('serializer'));
|
||||
$data = $this->createItem($invoice, $transformer, 'invoice');
|
||||
return $this->response($data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user