Updated backend
This commit is contained in:
parent
ca1024c343
commit
531b51355f
1 changed files with 4 additions and 3 deletions
|
|
@ -455,8 +455,9 @@ func connect() {
|
||||||
|
|
||||||
router.POST("/api/post-registration", func(c *gin.Context) {
|
router.POST("/api/post-registration", func(c *gin.Context) {
|
||||||
type RegistrationData struct {
|
type RegistrationData struct {
|
||||||
Data string `json:"data"`
|
Data int `json:"data"`
|
||||||
Data2 string `json:"data2"`
|
Data2 string `json:"data2"`
|
||||||
|
Data3 string `json:"data3"`
|
||||||
}
|
}
|
||||||
var registrationData RegistrationData
|
var registrationData RegistrationData
|
||||||
if err := c.ShouldBindJSON(®istrationData); err != nil {
|
if err := c.ShouldBindJSON(®istrationData); err != nil {
|
||||||
|
|
@ -471,13 +472,13 @@ func connect() {
|
||||||
c.Writer.Header().Set("X-Download-Options", "noopen")
|
c.Writer.Header().Set("X-Download-Options", "noopen")
|
||||||
c.Writer.Header().Set("Referrer-Policy", "no-referrer")
|
c.Writer.Header().Set("Referrer-Policy", "no-referrer")
|
||||||
|
|
||||||
dbpost, err := db.Prepare("INSERT INTO esign (esignid, employeeid, signature) VALUES (NULL, ?, ?)")
|
dbpost, err := db.Prepare("INSERT INTO esign (esignid, employeeid, signature, image) VALUES (NULL, ?, ?, ?)")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err.Error())
|
panic(err.Error())
|
||||||
}
|
}
|
||||||
defer dbpost.Close()
|
defer dbpost.Close()
|
||||||
|
|
||||||
exec, err := dbpost.Exec(registrationData.Data, registrationData.Data2)
|
exec, err := dbpost.Exec(registrationData.Data, registrationData.Data2, registrationData.Data3)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err.Error())
|
panic(err.Error())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue