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
6c48a22f86
commit
f2bf88ec90
@ -183,6 +183,11 @@ class AccompanyingCourseController extends Controller
|
|||||||
$workflow = $this->registry->get($accompanyingCourse);
|
$workflow = $this->registry->get($accompanyingCourse);
|
||||||
|
|
||||||
if ($workflow->can($accompanyingCourse, 'close')) {
|
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');
|
$workflow->apply($accompanyingCourse, 'close');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user