Commit e7ad6f93 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix : Affichage des erreurs lors de l'annulation d'une déclaration (format JSON)

parent 40049e8b
Loading
Loading
Loading
Loading
+4 −0
Changes for module/Oscar/src/Oscar/Controller/TimesheetController.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2059,11 +2059,15 @@ class TimesheetController extends AbstractOscarController
                case 'DELETE':
                    $person_id = $this->params()->fromQuery('person_id');
                    $period = $this->params()->fromQuery('period');
                    try {
                        if( $person_id ){
                            $person = $this->getPersonService()->getPerson($person_id);
                        }
                        $this->getTimesheetService()->deleteValidationPeriodPerson($person, $period);
                        return $this->getResponseOk();
                    } catch (\Exception $e) {
                        return $this->getResponseInternalError($e->getMessage());
                    }

                default:
                    return $this->getResponseInternalError("Non pris en charge");