fix: tower backbone_code tidak tersimpan saat edit
- Ubah map key dari "BackboneCode" ke "backbone_code" di UpdateTowerWithMultipleImages
agar GORM memetakan ke nama kolom yang benar di database
- Ubah c.PostForm("device_id") ke c.PostForm("dev_id") di UpdateTower controller
agar konsisten dengan key yang dikirim frontend dan handler CreateTower
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
426d3b16f6
commit
e5f5314253
|
|
@ -282,7 +282,7 @@ func (tc *TowerController) UpdateTower() gin.HandlerFunc {
|
|||
towerUpdateDTO := req.UpdateTowerDTO{}
|
||||
|
||||
// Optional fields - handle form data
|
||||
if deviceIDStr := c.PostForm("device_id"); deviceIDStr != "" {
|
||||
if deviceIDStr := c.PostForm("dev_id"); deviceIDStr != "" {
|
||||
if deviceID, err := uuid.Parse(deviceIDStr); err == nil {
|
||||
towerUpdateDTO.DeviceID = &deviceID
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ func (u *towerUsecase) UpdateTowerWithMultipleImages(id uuid.UUID, tower req.Upd
|
|||
updates["ImageURL"] = *tower.ImageURL
|
||||
}
|
||||
if tower.BackboneCode != nil {
|
||||
updates["BackboneCode"] = *tower.BackboneCode
|
||||
updates["backbone_code"] = *tower.BackboneCode
|
||||
}
|
||||
|
||||
// Handle multiple image uploads
|
||||
|
|
|
|||
Loading…
Reference in New Issue