Used new api for updating op
This commit is contained in:
parent
a7e47cfc90
commit
fb518587b1
1 changed files with 17 additions and 1 deletions
|
|
@ -98,6 +98,7 @@ export default () => {
|
|||
const approveHandler = async (application: string) => {
|
||||
let signed: boolean = false
|
||||
let forprinting: boolean = false
|
||||
let updateOrderofpayment: boolean = false
|
||||
|
||||
setConnected(await checkConnection())
|
||||
if (connected() === false) {
|
||||
|
|
@ -109,8 +110,11 @@ export default () => {
|
|||
if (!signed) return
|
||||
|
||||
forprinting = await setNewStatus('FOR ELECTRICAL ORDER OF PAYMENT PRINTING', '95', 'ELECOPPRINT')
|
||||
if (!forprinting) return
|
||||
|
||||
if (forprinting) {
|
||||
updateOrderofpayment = await updateOp()
|
||||
|
||||
if (updateOrderofpayment) {
|
||||
setApprovedApplication(application)
|
||||
setApproved(true)
|
||||
}
|
||||
|
|
@ -132,6 +136,18 @@ export default () => {
|
|||
}
|
||||
}
|
||||
|
||||
const updateOp = async () => {
|
||||
try {
|
||||
await ofetch(API + 'update-op-electrical', {
|
||||
method: 'POST',
|
||||
body: { data: parseInt(applicationId().toString()) },
|
||||
})
|
||||
return true
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const calculateAmounts = () => {
|
||||
const amounts: string[] = amountList()
|
||||
let gflguList: number[] = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue