Merge branch 'dev' of bitbucket.org:jubilian/nhance-enrollment into dev

This commit is contained in:
Gowtham M 2026-02-07 11:50:07 +05:30
commit 20ef380c5b

View File

@ -4245,13 +4245,13 @@ class EmployeeRestController extends AdminController
$file_id = $this->request->getGet('id') ?? $id;
// Find record
$record = $this->hrFileUploadModel->find($file_id);
$record = $this->fileModel->where('id', $file_id)->first();
if (!$record) {
return $this->failNotFound("File record not found");
}
$uploadPath = WRITEPATH . 'uploads/hr_files/';
$uploadPath = WRITEPATH . 'uploads/excel/';
$filePath = $uploadPath . $record['file_name'];
if (!file_exists($filePath)) {
@ -4259,8 +4259,8 @@ class EmployeeRestController extends AdminController
}
// Force file download
return $this->response->download($filePath, null)
->setFileName($record['file_name']);
return $this->response->download($filePath, null)->setFileName($record['file_name']);
} catch (\Exception $e) {
return $this->failServerError($e->getMessage());
}