mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-22 14:30:57 -04:00
remove redundant method
This commit is contained in:
parent
4a9a9dc823
commit
f48ac1b6f0
@ -249,7 +249,7 @@ class InvoiceApiController extends BaseAPIController
|
||||
return $item;
|
||||
}
|
||||
|
||||
public function emailInvoicev2()
|
||||
public function emailInvoice()
|
||||
{
|
||||
$data = Input::all();
|
||||
$error = null;
|
||||
@ -269,31 +269,6 @@ class InvoiceApiController extends BaseAPIController
|
||||
return Response::make($response, $error ? 400 : 200, $headers);
|
||||
}
|
||||
|
||||
public function emailInvoice()
|
||||
{
|
||||
$data = Input::all();
|
||||
$error = null;
|
||||
|
||||
if (!isset($data['id'])) {
|
||||
$error = trans('validation.required', ['attribute' => 'id']);
|
||||
} else {
|
||||
$invoice = Invoice::scope($data['id'])->first();
|
||||
if (!$invoice) {
|
||||
$error = trans('validation.not_in', ['attribute' => 'id']);
|
||||
} else {
|
||||
$this->mailer->sendInvoice($invoice);
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$response = json_encode($error, JSON_PRETTY_PRINT);
|
||||
} else {
|
||||
$response = json_encode(RESULT_SUCCESS, JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
||||
$headers = Utils::getApiHeaders();
|
||||
return Response::make($response, $error ? 400 : 200, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* @SWG\Put(
|
||||
|
Loading…
x
Reference in New Issue
Block a user