This commit is contained in:
ivan-sim
2024-01-19 14:08:43 +07:00
parent b74ef82239
commit efe0d86169
2 changed files with 6 additions and 7 deletions

View File

@@ -38,7 +38,7 @@ export default function TableListFinalLog() {
const [data, setData] = useState([]);
// Download LOG
async function handleDownloadLog(request_log_id: any, service_code:any, no_polis:any, full_name:any) {
async function handleDownloadLog(request_log_id: any, service_code:any, no_polis:any, full_name:any, provider:any) {
return axios
.get(`download-final-log/${request_log_id}`, {
responseType: 'blob',
@@ -46,7 +46,7 @@ export default function TableListFinalLog() {
.then((response) => {
console.log(response);
// GL Akhir-010124-OP-00001234 Ratih-LinkSehat
const namaFile = 'GL Akhir-'+getFormattedToday()+'-'+service_code+'-'+no_polis+'-'+full_name+'-LinkSehat.pdf';
const namaFile = 'GL Akhir-'+provider+'-'+getFormattedToday()+'-'+service_code+'-'+no_polis+'-'+full_name+'-LinkSehat.pdf';
const url = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = url;
@@ -369,7 +369,7 @@ export default function TableListFinalLog() {
View
</MenuItem>
{obj.status === 'approved' ? (
<MenuItem onClick={() => handleDownloadLog(obj.id, obj.service_code, obj.no_polis, obj.full_name)}>
<MenuItem onClick={() => handleDownloadLog(obj.id, obj.service_code, obj.no_polis, obj.full_name, obj.provider)}>
<Iconify icon="eva:download-fill" />
Download Final LOG
</MenuItem>

View File

@@ -42,15 +42,14 @@ export default function TableList() {
const [data, setData] = useState([]);
// Download LOG
async function handleDownloadLog(request_log_id: any, service_code:any, no_polis:any, full_name:any) {
async function handleDownloadLog(request_log_id: any, service_code:any, no_polis:any, full_name:any, provider:any) {
return axios
.get(`download-log/${request_log_id}`, {
responseType: 'blob',
})
.then((response) => {
console.log(response);
// GL Awal-010124-OP-00001234 Ratih-LinkSehat
const namaFile = 'GL Awal-'+getFormattedToday()+'-'+service_code+'-'+no_polis+'-'+full_name+'-LinkSehat.pdf';
const namaFile = 'GL Awal-'+provider+'-'+getFormattedToday()+'-'+service_code+'-'+no_polis+'-'+full_name+'-LinkSehat.pdf';
const url = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = url;
@@ -368,7 +367,7 @@ export default function TableList() {
View
</MenuItem>
{obj.status === 'approved' ? (
<MenuItem onClick={() => handleDownloadLog(obj.id, obj.service_code, obj.no_polis, obj.full_name)}>
<MenuItem onClick={() => handleDownloadLog(obj.id, obj.service_code, obj.no_polis, obj.full_name, obj.provider)}>
<Iconify icon="eva:download-fill" />
Download LOG
</MenuItem>