|
|
@@ -284,20 +284,14 @@ exports.excel = handleError(async (req, res) => {
|
|
|
|
|
|
const buffer = excel.to_excel([
|
|
|
{
|
|
|
- SheetNames: 'delegasi',
|
|
|
+ SheetNames: 'Laporan Delegasi',
|
|
|
data,
|
|
|
},
|
|
|
])
|
|
|
|
|
|
- const dokumen = await addDokumen({
|
|
|
- originalname: req.params.nama_file,
|
|
|
- buffer,
|
|
|
- mimetype:
|
|
|
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
|
- })
|
|
|
-
|
|
|
- return response.success(res, {
|
|
|
- message: 'berhasil membuat exel',
|
|
|
- data: dokumen,
|
|
|
- })
|
|
|
+ res.header(
|
|
|
+ 'Content-Type',
|
|
|
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
+ )
|
|
|
+ return res.end(Buffer.from(buffer))
|
|
|
})
|