From ab9732a86074917d8411e96ebed6d99eba21bbc0 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Mon, 20 Nov 2023 14:09:34 +0700
Subject: Update logic compute is different

---
 src/modules/result/components/Table.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/modules/result/components/Table.tsx')

diff --git a/src/modules/result/components/Table.tsx b/src/modules/result/components/Table.tsx
index 021dfef..8a29fd4 100644
--- a/src/modules/result/components/Table.tsx
+++ b/src/modules/result/components/Table.tsx
@@ -13,6 +13,7 @@ import getClientCredential from "@/common/libs/getClientCredential";
 import { SHOWING_SELECTIONS } from "@/common/constants/result";
 import Link from "next/link";
 import { useState } from "react";
+import moment from "moment";
 
 const Table = () => {
   const credential = getClientCredential()
@@ -51,12 +52,13 @@ const Table = () => {
     setExportLoad(true)
     const response = await fetch(`/api/stock-opname/export?companyId=${filter.company}`)
     const buffer = await response.arrayBuffer()
+    console.log({ type: response.headers.get('type') });
 
     const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
     const url = window.URL.createObjectURL(blob)
     const a = document.createElement('a')
     a.href = url
-    a.download = 'export.xlsx'
+    a.download = `export_${moment().format('MM_DD_HH_ss')}.xlsx`
     document.body.appendChild(a)
     a.click()
     document.body.removeChild(a)
-- 
cgit v1.2.3

