@@ -421,22 +421,22 @@ public function putById($id)
421421 ]);
422422 }
423423
424- // try {
425- // $this->validate($this->request, [
426- // 'countryCode' => 'alpha|size:3',
427- // 'eventType' => 'string|max:50',
428- // 'regionName' => 'nullable|string',
429- // 'translations' => 'array',
430- // 'translations.*.webUrl' => 'nullable|string',
431- // 'translations.*.lang' => 'alpha|size:2',
432- // 'translations.*.title' => 'string',
433- // 'translations.*.description' => 'string',
434- // ]);
435- // } catch (ValidationException $e) {
436- // Log::info($e->getMessage());
437-
438- // return $e->getResponse();
439- // }
424+ try {
425+ $ this ->validate ($ this ->request , [
426+ 'countryCode ' => 'alpha|size:3 ' ,
427+ 'eventType ' => 'string|max:50 ' ,
428+ 'regionName ' => 'nullable|string ' ,
429+ 'translations ' => 'array ' ,
430+ 'translations.*.webUrl ' => 'nullable|string ' ,
431+ 'translations.*.lang ' => 'alpha|size:2 ' ,
432+ 'translations.*.title ' => 'string ' ,
433+ 'translations.*.description ' => 'string ' ,
434+ ]);
435+ } catch (ValidationException $ e ) {
436+ Log::info ($ e ->getMessage ());
437+
438+ return $ e ->getResponse ();
439+ }
440440
441441 try {
442442 $ org = $ this ->orgRepo ->findByCountryCode ($ this ->request ->input ('countryCode ' ));
@@ -478,7 +478,6 @@ public function putById($id)
478478 return response ()->json ([
479479 'status ' => 500 ,
480480 'error_message ' => $ e ->getMessage (),
481- // 'error_message' => 'Unable to update item',
482481 'errors ' => ['Error updating item ' ],
483482 ], 500 );
484483 }
0 commit comments