Upstream sync
This commit is contained in:
@@ -57,7 +57,7 @@ func SaveDeviceInfo(c *gin.Context) {
|
||||
} else {
|
||||
log.Printf("Current device deleted at: %v", device.DeletedAt)
|
||||
|
||||
if device.DeletedAt != nil {
|
||||
if device.DeletedAt.Valid {
|
||||
// Use raw SQL to update the record
|
||||
if err := shared.GetDb().Exec("UPDATE devices SET deleted_at = NULL, company_id = NULL WHERE id = ?", device.ID).Error; err != nil {
|
||||
log.Printf("UNDELETE -Device DB Error: %v", err)
|
||||
@@ -161,5 +161,5 @@ func GetDevicesByContract(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
// Respond with the devices
|
||||
c.JSON(http.StatusOK,gin.H{"data" : models.ConvertDeviceToResponse(devices)})
|
||||
c.JSON(http.StatusOK, gin.H{"data": models.ConvertDeviceToResponse(devices)})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user