Skip to content

Commit

Permalink
Merge pull request #24 from jjang-go/migration-mysql
Browse files Browse the repository at this point in the history
fix: mysql migration formData error correction
  • Loading branch information
yunkon-kim authored Nov 15, 2023
2 parents 33e4ca3 + 66cf935 commit ec32e35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions websrc/controllers/migrationHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,23 +428,14 @@ func MigrationMySQLPostHandler() gin.HandlerFunc {
logger, logstrings := pageLogInit("migmysql", "Import mysql to mysql", start)

formdata := MigrationMySQLForm{}
params := GetMigrationParamsFormFormData(formdata)

if err := ctx.ShouldBind(&params); err != nil {
if !getDataWithBind(logger, start, ctx, &formdata) {
ctx.JSONP(http.StatusOK, gin.H{
"Result": "failed to send Form data",
"Error": err,
"Result": logstrings.String(),
"Error": nil,
})
return
}

// if !getDataWithBind(logger, start, ctx, &params) {
// ctx.JSONP(http.StatusOK, gin.H{
// "Result": logstrings.String(),
// "Error": nil,
// })
// return
// }
params := GetMigrationParamsFormFormData(formdata)

srdbc := getMysqlRDBC(logger, start, "smig", params)
if srdbc == nil {
Expand Down
2 changes: 1 addition & 1 deletion websrc/controllers/migrationStructs.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type MigrationMySQLForm struct {
SDatabaseName string `json:"srcDatabaseName" form:"srcDatabaseName"`

DProvider string `json:"destProvider" form:"destProvider"`
DHost string `json:"destHost" form:"desttHost"`
DHost string `json:"destHost" form:"destHost"`
DPort string `json:"destPort" form:"destPort"`
DUsername string `json:"destUsername" form:"destUsername"`
DPassword string `json:"destPassword" form:"destPassword"`
Expand Down

0 comments on commit ec32e35

Please sign in to comment.