diff --git a/src/pages/MainPage/Main.tsx b/src/pages/MainPage/Main.tsx index 43554ef..19318e5 100644 --- a/src/pages/MainPage/Main.tsx +++ b/src/pages/MainPage/Main.tsx @@ -107,6 +107,7 @@ export default () => { if (updateOrderofpayment) { setApprovedApplication(application) setApproved(true) + postTransaction() } } @@ -191,6 +192,26 @@ export default () => { return true } + const geteSignId = async () => { + try { + const response = await ofetch(API + 'get-esignid/' + ID, { parseResponse: JSON.parse }) + const result = response.result + return result + } catch { + return 0 + } + } + + const postTransaction = async () => { + const id = await geteSignId() + const today = new Date() + const formatedDate = dayjs(today).format('YYYY-MM-DD HH:mm:ss') + await ofetch(API + 'post-esigntransaction', { + method: 'POST', + body: { data: parseInt(id), data2: approvedApplication(), data3: formatedDate }, + }) + } + const logout = async () => { removeEmployee() navigate('/')