Rename of service before use

This commit is contained in:
PMKuipers 2023-06-26 11:57:05 +02:00
parent e64e87f373
commit 9da93a73d9
2 changed files with 5 additions and 5 deletions

View File

@ -448,20 +448,20 @@ class associationservice extends \external_api
});
}
public static function enrol_cohortsync_parameters()
public static function cascade_cohortsync_parameters()
{
return new \external_function_parameters( [
"studyplan_id" => new \external_value(PARAM_INT, 'id of studyplan', VALUE_OPTIONAL),
] );
}
public static function enrol_cohortsync_returns()
public static function cascade_cohortsync_returns()
{
return success::structure();
}
// Actual functions
public static function enrol_cohortsync($studyplan_id)
public static function casdade_cohortsync($studyplan_id)
{
$studyplan = studyplan::findById($studyplan_id);
webservicehelper::require_capabilities(self::CAP_EDIT,$studyplan->context());

View File

@ -542,9 +542,9 @@ $functions = [
'ajax' => true,
'loginrequired' => true,
],
'local_treestudyplan_enrol_cohortsync' => [ //web service function name
'local_treestudyplan_cascade_cohortsync' => [ //web service function name
'classname' => '\local_treestudyplan\associationservice', //class containing the external function
'methodname' => 'enrol_cohortsync', //external function name
'methodname' => 'cascade_cohortsync', //external function name
'description' => 'Sync cohortsync to studyplan association', //human readable description of the web service function
'type' => 'read', //database rights of the web service function (read, write)
'capabilities' => 'local/treestudyplan:editstudyplan', // Advises the admin which capabilities are required