From cc6e4e6cb077241905d042884fd98e6579436945 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Wed, 15 Oct 2025 09:03:35 +0800 Subject: [PATCH] For deployment --- backend/main.go | 26 +++++++++++++------------- src/pages/AssessorPage/Assessor.tsx | 22 ++++++++++------------ 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/backend/main.go b/backend/main.go index 751706c..67bb890 100644 --- a/backend/main.go +++ b/backend/main.go @@ -18,10 +18,10 @@ import ( ) // DEV -var connection string = "root:superuser@tcp(localhost:3306)/iips" +// var connection string = "root:superuser@tcp(localhost:3306)/iips" // SERVER -// var connection string = "iips:iipsuser@tcp(192.168.7.100:3306)/iips" +var connection string = "iips:iipsuser@tcp(192.168.7.100:3306)/iips" func main() { connect() @@ -40,24 +40,24 @@ func connect() { // router.Use(cors.Default()) //DEV - router.Use(cors.New(cors.Config{ - AllowOrigins: []string{"http://localhost:5173"}, - // AllowAllOrigins: true, - AllowMethods: []string{"GET", "POST"}, - AllowHeaders: []string{"Origin", "OCBO-ShieldConnection"}, - ExposeHeaders: []string{"Content-Length"}, - AllowCredentials: true, - })) - - //SERVER // router.Use(cors.New(cors.Config{ - // AllowOrigins: []string{"http://192.168.7.160:8080/inquiry"}, + // AllowOrigins: []string{"http://localhost:5173"}, + // // AllowAllOrigins: true, // AllowMethods: []string{"GET", "POST"}, // AllowHeaders: []string{"Origin", "OCBO-ShieldConnection"}, // ExposeHeaders: []string{"Content-Length"}, // AllowCredentials: true, // })) + //SERVER + router.Use(cors.New(cors.Config{ + AllowOrigins: []string{"http://192.168.7.160:8080/esign"}, + AllowMethods: []string{"GET", "POST"}, + AllowHeaders: []string{"Origin", "OCBO-ShieldConnection"}, + ExposeHeaders: []string{"Content-Length"}, + AllowCredentials: true, + })) + router.StaticFile("/", "static/index.html") // shield := "inquiry" diff --git a/src/pages/AssessorPage/Assessor.tsx b/src/pages/AssessorPage/Assessor.tsx index aa183ba..c0491a5 100644 --- a/src/pages/AssessorPage/Assessor.tsx +++ b/src/pages/AssessorPage/Assessor.tsx @@ -48,8 +48,6 @@ export default () => { const [employeeId, setEmployeeId] = createSignal(0) const [employeeName, setEmployeeName] = createSignal('') - const [sign, setSign] = createSignal('') - // const [docApplicationNo, setDocApplicationNo] = createSignal('') // const [docDate, setDocDate] = createSignal('') // const [docLocation, setDocLocation] = createSignal('') @@ -202,19 +200,19 @@ export default () => { return } - // signed = await setNewStatus('ELECTRICAL ORDER OF PAYMENT PRINTED', '171', 'ELECOPPRINTED') - // if (!signed) return + signed = await setNewStatus('ELECTRICAL ORDER OF PAYMENT PRINTED', '171', 'ELECOPPRINTED') + if (!signed) return - // forprinting = await setNewStatus('FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION', '98', 'ELECORVALIDATE') - // if (!forprinting) return + forprinting = await setNewStatus('FOR ELECTRICAL OFFICIAL RECEIPT VALIDATION', '98', 'ELECORVALIDATE') + if (!forprinting) return - // updateOrderofpayment = await updateOp() + updateOrderofpayment = await updateOp() - // if (updateOrderofpayment) { - // setPrintedApplication(application) - // setPrinted(true) - createPdf() - // } + if (updateOrderofpayment) { + setPrintedApplication(application) + setPrinted(true) + createPdf() + } } const updateOp = async () => {