mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 01:47:32 -05:00 
			
		
		
		
	Merge pull request #664 from turbo124/master
Restore and invoice from the API
This commit is contained in:
		
						commit
						76683e10b2
					
				@ -316,6 +316,15 @@ class InvoiceApiController extends BaseAPIController
 | 
			
		||||
 | 
			
		||||
            return $this->response($data);
 | 
			
		||||
        }
 | 
			
		||||
        else if ($request->action == ACTION_RESTORE) {
 | 
			
		||||
            $invoice = Invoice::scope($publicId)->withTrashed()->firstOrFail();
 | 
			
		||||
            $this->invoiceRepo->restore($invoice);
 | 
			
		||||
 | 
			
		||||
            $transformer = new InvoiceTransformer(\Auth::user()->account, Input::get('serializer'));
 | 
			
		||||
            $data = $this->createItem($invoice, $transformer, 'invoice');
 | 
			
		||||
 | 
			
		||||
            return $this->response($data);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $data = $request->input();
 | 
			
		||||
        $data['public_id'] = $publicId;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user