Add import customers functionality to XL Vask module
This commit is contained in:
@@ -8,6 +8,7 @@ use classes\router;
|
||||
use classes\xlvask;
|
||||
use objects\orders_o;
|
||||
use objects\users_o;
|
||||
use objects\xlvask_customers_o;
|
||||
use traits\route_t;
|
||||
|
||||
class moduleXLVaskRoute
|
||||
@@ -215,5 +216,21 @@ class moduleXLVaskRoute
|
||||
'modules_xlvask_sync_usage' => 'Synchronize usage with the xlvask module'
|
||||
]
|
||||
);
|
||||
|
||||
$this->get('/modules/xlvask/tasks/import-customers', function () {
|
||||
global $response;
|
||||
self::requirePermission('modules_xlvask_import_customers');
|
||||
// Create the xlvask_customers_o object
|
||||
$xlvask_customers_o = new xlvask_customers_o();
|
||||
$xlvask_customers_o->importCustomers();
|
||||
$response->success(
|
||||
'Customers imported',
|
||||
200
|
||||
);
|
||||
},
|
||||
[
|
||||
'modules_xlvask_import_customers' => 'Import customers from the xlvask module'
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user