Updated main page

This commit is contained in:
Patrick Alvin Alcala 2025-10-16 10:09:42 +08:00
parent 8f8114094a
commit 6b651b8958

View file

@ -107,6 +107,7 @@ export default () => {
if (updateOrderofpayment) { if (updateOrderofpayment) {
setApprovedApplication(application) setApprovedApplication(application)
setApproved(true) setApproved(true)
postTransaction()
} }
} }
@ -191,6 +192,26 @@ export default () => {
return true 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 () => { const logout = async () => {
removeEmployee() removeEmployee()
navigate('/') navigate('/')