mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
adjustment to apply validation
This commit is contained in:
parent
a20d7222a8
commit
57cf46a0af
@ -183,6 +183,11 @@ class AccompanyingCourseController extends Controller
|
||||
$workflow = $this->registry->get($accompanyingCourse);
|
||||
|
||||
if ($workflow->can($accompanyingCourse, 'close')) {
|
||||
$errors = $this->validator->validate($accompanyingCourse, null, [$accompanyingCourse::STEP_CLOSED]);
|
||||
if( count($errors) > 0 ){
|
||||
return $this->json($errors, 422);
|
||||
}
|
||||
|
||||
$workflow->apply($accompanyingCourse, 'close');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user