From a38a29bc2d0b167a834d906354e39789662814c1 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Sun, 8 Nov 2015 19:06:26 +0000 Subject: [PATCH] component_status is required if we send component_id. Closes #1112 --- app/Commands/Incident/ReportIncidentCommand.php | 2 +- app/Commands/Incident/UpdateIncidentCommand.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Commands/Incident/ReportIncidentCommand.php b/app/Commands/Incident/ReportIncidentCommand.php index fd736798..25bae98a 100644 --- a/app/Commands/Incident/ReportIncidentCommand.php +++ b/app/Commands/Incident/ReportIncidentCommand.php @@ -80,7 +80,7 @@ final class ReportIncidentCommand 'message' => 'string', 'visible' => 'bool', 'component_id' => 'int', - 'component_status' => 'int|min:1|max:4', + 'component_status' => 'int|min:1|max:4|required_with:component_id', 'notify' => 'bool', 'incident_date' => 'string', ]; diff --git a/app/Commands/Incident/UpdateIncidentCommand.php b/app/Commands/Incident/UpdateIncidentCommand.php index 07387ff9..41c7ddd4 100644 --- a/app/Commands/Incident/UpdateIncidentCommand.php +++ b/app/Commands/Incident/UpdateIncidentCommand.php @@ -85,11 +85,11 @@ final class UpdateIncidentCommand */ public $rules = [ 'name' => 'string', - 'status' => 'int', + 'status' => 'int|min:0|max:4', 'message' => 'string', 'visible' => 'bool', 'component_id' => 'int', - 'component_status' => 'int', + 'component_status' => 'int|min:1|max:4|required_with:component_id', 'notify' => 'bool', ];