mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:07:32 -05:00 
			
		
		
		
	Improving error reporting API
This commit is contained in:
		
							parent
							
								
									170ee5a40b
								
							
						
					
					
						commit
						1fde9261e6
					
				@ -289,10 +289,10 @@ class InvoiceApiController extends BaseAPIController
 | 
			
		||||
            return $this->errorResponse(['message'=>'Invoice does not exist.'], 400);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        $emailResponse = $this->mailer->sendInvoice($invoice, false, false);
 | 
			
		||||
        $this->mailer->sendInvoice($invoice, false, $invoice->getPDFString());
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        if($emailResponse === FALSE) {
 | 
			
		||||
        if($error) {
 | 
			
		||||
            return $this->errorResponse(['message'=>'There was an error sending the invoice'], 400);
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
 | 
			
		||||
@ -41,8 +41,6 @@ class ContactMailer extends Mailer
 | 
			
		||||
        $client = $invoice->client;
 | 
			
		||||
        $account = $invoice->account;
 | 
			
		||||
 | 
			
		||||
        $response = false;
 | 
			
		||||
 | 
			
		||||
        if ($client->trashed()) {
 | 
			
		||||
            return trans('texts.email_errors.inactive_client');
 | 
			
		||||
        } elseif ($invoice->trashed()) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user