diff --git a/app/Controllers/PolicyController.php b/app/Controllers/PolicyController.php index da21a59..00ab21a 100644 --- a/app/Controllers/PolicyController.php +++ b/app/Controllers/PolicyController.php @@ -119,7 +119,7 @@ class PolicyController extends ResourceController 'rto_city_code' => $data['rto_city_code'] ?? null, 'weight' => $data['weight'] ?? null, 'fuel_type' => $data['fuel_type'] ?? null, - 'date_of_registration' => $data['date_of_registration'] ? format_date_for_database($data['date_of_registration']) : null, + 'date_of_registration' => !empty($data['date_of_registration']) ? format_date_for_database($data['date_of_registration']) : null, 'year_of_manufacture' => $data['year_of_manufacture'] ?? null, 'engine_no' => $data['engine_no'] ?? null, 'chassis_no' => $data['chassis_no'] ?? null, @@ -198,7 +198,7 @@ class PolicyController extends ResourceController 'rto_city_code' => $data['rto_city_code'] ?? null, 'weight' => $data['weight'] ?? null, 'fuel_type' => $data['fuel_type'] ?? null, - 'date_of_registration' => $data['date_of_registration'] ? format_date_for_database($data['date_of_registration']) : null, + 'date_of_registration' => !empty($data['date_of_registration']) ? format_date_for_database($data['date_of_registration']) : null, 'year_of_manufacture' => $data['year_of_manufacture'] ?? null, 'engine_no' => $data['engine_no'] ?? null, 'chassis_no' => $data['chassis_no'] ?? null,