fix: prevent empty name/description from overwriting on partial update
This commit is contained in:
@@ -365,8 +365,12 @@ func handleUpdateApplication(c *gin.Context) {
|
||||
|
||||
fmt.Printf("更新应用前: ID=%d, EncryptType=%s, EncryptKey=%s\n", app.ID, app.EncryptType, app.EncryptKey)
|
||||
|
||||
app.Name = req.Name
|
||||
app.Description = req.Description
|
||||
if req.Name != "" {
|
||||
app.Name = req.Name
|
||||
}
|
||||
if req.Description != "" {
|
||||
app.Description = req.Description
|
||||
}
|
||||
if req.BillingType != "" {
|
||||
app.BillingType = req.BillingType
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user