mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 01:47:32 -05:00 
			
		
		
		
	Add 'action' to API docs
This commit is contained in:
		
							parent
							
								
									c433661d11
								
							
						
					
					
						commit
						827b93e40c
					
				@ -74,6 +74,10 @@ class BaseAPIController extends Controller
 | 
				
			|||||||
        $entity = $request->entity();
 | 
					        $entity = $request->entity();
 | 
				
			||||||
        $action = $request->action;
 | 
					        $action = $request->action;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (! in_array($action, ['archive', 'delete', 'restore'])) {
 | 
				
			||||||
 | 
					            return $this->errorResponse('Action is not supported');
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $repo = Utils::toCamelCase($this->entityType) . 'Repo';
 | 
					        $repo = Utils::toCamelCase($this->entityType) . 'Repo';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this->$repo->$action($entity);
 | 
					        $this->$repo->$action($entity);
 | 
				
			||||||
 | 
				
			|||||||
@ -107,6 +107,11 @@ Updating Data
 | 
				
			|||||||
    -d '{"name":"test", "contacts":[{"id": 1, "first_name": "test"}]}' \
 | 
					    -d '{"name":"test", "contacts":[{"id": 1, "first_name": "test"}]}' \
 | 
				
			||||||
    -H "X-Ninja-Token: TOKEN"
 | 
					    -H "X-Ninja-Token: TOKEN"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					You can archive, delete or restore an entity by setting ``action`` in the request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  curl -X PUT ninja.dev/api/v1/invoices/1?action=archive \
 | 
				
			||||||
 | 
					    -H "X-Ninja-Token: TOKEN"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Emailing Invoices
 | 
					Emailing Invoices
 | 
				
			||||||
"""""""""""""""""
 | 
					"""""""""""""""""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user