Fixed errors
This commit is contained in:
parent
05639b163a
commit
217fcfa97e
1 changed files with 7 additions and 7 deletions
|
|
@ -2296,7 +2296,7 @@ func connect() {
|
|||
c.Writer.Header().Set("Content-Security-Policy", "default-src 'self'; img-src 'self';")
|
||||
c.Writer.Header().Set("X-Server", "OCBO Server")
|
||||
|
||||
dbpost, err := db.Prepare("INSERT INTO esign_lock (esign_lockid, ?, ?)")
|
||||
dbpost, err := db.Prepare("INSERT INTO esign_lock (esign_lockid, referenceNo, lock_code) VALUES (NULL, ?, ?)")
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusInternalServerError, err)
|
||||
c.String(http.StatusInternalServerError, "Internal Server Error")
|
||||
|
|
@ -2435,9 +2435,9 @@ func connect() {
|
|||
}
|
||||
})
|
||||
|
||||
router.DELETE("/api/void-op-local", middleware.TokenChecker(), func(c *gin.Context) {
|
||||
router.DELETE("/api/void-op-local", func(c *gin.Context) {
|
||||
type DeleteOPLocal struct {
|
||||
Data int `json:"data"`
|
||||
Data string `json:"data"`
|
||||
}
|
||||
var deleteOpLocal DeleteOPLocal
|
||||
if err := c.ShouldBindJSON(&deleteOpLocal); err != nil {
|
||||
|
|
@ -2454,20 +2454,20 @@ func connect() {
|
|||
c.Writer.Header().Set("Content-Security-Policy", "default-src 'self'; img-src 'self';")
|
||||
c.Writer.Header().Set("X-Server", "OCBO Server")
|
||||
|
||||
var isPaid int
|
||||
checkErr := db.QueryRow("SELECT COUNT(AFNum) FROM orderpaydetails WHERE OPRefId = ?", deleteOpLocal.Data).Scan(&isPaid)
|
||||
var resultCount int
|
||||
checkErr := dbpop.QueryRow("SELECT COUNT(AFNum) AS resultCount FROM orderpaydetail WHERE OPRefId = ?", deleteOpLocal.Data).Scan(&resultCount)
|
||||
if checkErr != nil {
|
||||
c.AbortWithError(http.StatusInternalServerError, checkErr)
|
||||
c.String(http.StatusInternalServerError, "Internal Server Error")
|
||||
return
|
||||
}
|
||||
|
||||
if isPaid == 1 {
|
||||
if resultCount > 0 {
|
||||
c.String(http.StatusBadRequest, "Error! Payment already exist.")
|
||||
return
|
||||
}
|
||||
|
||||
dbpost, err := db.Prepare("DELETE FROM orderpaydetails WHERE OPRefId = ?")
|
||||
dbpost, err := dbpop.Prepare("DELETE FROM orderpaydetail WHERE OPRefId = ?")
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusInternalServerError, err)
|
||||
c.String(http.StatusInternalServerError, "Internal Server Error")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue