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