code: func checkDuplicateProfileNames(dp models.DeviceProfile, w http.ResponseWriter) error {
  	profiles, err := dbClient.GetAllDeviceProfiles()
  	if err != nil {
  		http.Error(w, err.Error(), http.StatusServiceUnavailable)
  		return err
  	}
  
  	for _, p := range profiles {
  		if p.Name == dp.Name && p.Id != dp.Id {
  			err = errors.New("Duplicate profile name")
  			http.Error(w, err.Error(), http.StatusConflict)
  			return err
  		}
  	}
  
  	return nil
  }
docs: // Check for duplicate names in device profiles