CHANGES_HR file upload changes : GWM

This commit is contained in:
Gowtham M 2025-08-20 11:29:53 +05:30
parent 06b3d4f0e8
commit a46d14881b

View File

@ -3502,8 +3502,12 @@ class EmployeeRestController extends AdminController
try { try {
// Check file // Check file
$file = $this->request->getFile('file_name'); $file = $this->request->getFile('file_name');
if (!$file->isValid()) { if (!$file) {
return $this->failValidationErrors(['file_name' => 'Invalid or missing file']); return $this->response->setJSON([
'status' => false,
'message' => "Invalid file or file not uploaded.",
'data' => "No Data"
]);
} }
// Upload folder path // Upload folder path
@ -3551,7 +3555,7 @@ class EmployeeRestController extends AdminController
{ {
try { try {
$file_id = $this->request->getFile('id') ?? $id; $file_id = $this->request->getGet('id') ?? $id;
// Find record // Find record
$record = $this->hrFileUploadModel->find($file_id); $record = $this->hrFileUploadModel->find($file_id);