Skip to content

Commit

Permalink
allow tags in ipxescript
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony ARNAUD <[email protected]>
  • Loading branch information
aarnaud committed Jan 23, 2024
1 parent 179aab1 commit 4f18085
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/ipxescript.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ func updateOrCreateComputer(c *gin.Context, id uuid.UUID, mac pgtype.Macaddr, ip

func searchComputer(db *gorm.DB, id uuid.UUID, mac pgtype.Macaddr) (models.Computer, error) {
computer := models.Computer{}
result := db.Where("uuid = ?", id).First(&computer)
result := db.Preload("Tags").Where("uuid = ?", id).First(&computer)
if result.RowsAffected > 0 {
return computer, nil
}
result = db.Where("mac = ?", mac.Addr.String()).First(&computer)
result = db.Preload("Tags").Where("mac = ?", mac.Addr.String()).First(&computer)
if result.RowsAffected > 0 {
return computer, nil
}
Expand Down

0 comments on commit 4f18085

Please sign in to comment.