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:
unknown 2026-04-12 18:37:19 +07:00
parent 426d3b16f6
commit e5f5314253
2 changed files with 2 additions and 2 deletions

View File

@ -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 {

View File

@ -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