v1.0 Initial commit of project
This commit is contained in:
29
pub/api/v1/customers/companies/activate/index.php
Normal file
29
pub/api/v1/customers/companies/activate/index.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use api\classes\API_companies;
|
||||
|
||||
session_start();
|
||||
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_companies.php';
|
||||
|
||||
|
||||
# Check permissions
|
||||
$API_companies = new API_companies();
|
||||
|
||||
|
||||
if ($API_companies->request_method === 'PUT') {
|
||||
$API_companies->checkPermissions('customer-companies', 'RW');
|
||||
|
||||
# when called from the frontend will not be forwarding to a url since when its called from the frontend it doesnt need a redirection
|
||||
$API_companies->return_url = false;
|
||||
|
||||
$requiredFields = [
|
||||
'company_uuid' => ['type' => 'uuid'],
|
||||
'company_state' => ['type' => 'enum', 'values' => ['active', 'imported', 'orphaned']]
|
||||
];
|
||||
|
||||
$API_companies->validateData($requiredFields);
|
||||
|
||||
$API_companies->updateCompanyState();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user