Skip to content

Commit

Permalink
fixed to use Creator instead of Inserter
Browse files Browse the repository at this point in the history
  • Loading branch information
dewrich authored and dangogh committed Feb 22, 2018
1 parent 4eba14b commit e08cd94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions traffic_ops/traffic_ops_golang/region/regions.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,14 @@ func (region *TORegion) Update(db *sqlx.DB, user auth.CurrentUser) (error, tc.Ap
return nil, tc.NoError
}

//The TORegion implementation of the Inserter interface
//all implementations of Inserter should use transactions and return the proper errorType
//The TORegion implementation of the Creator interface
//all implementations of Creator should use transactions and return the proper errorType
//ParsePQUniqueConstraintError is used to determine if a region with conflicting values exists
//if so, it will return an errorType of DataConflict and the type should be appended to the
//generic error message returned
//The insert sql returns the id and lastUpdated values of the newly inserted region and have
//to be added to the struct
func (region *TORegion) Insert(db *sqlx.DB, user auth.CurrentUser) (error, tc.ApiErrorType) {
func (region *TORegion) Create(db *sqlx.DB, user auth.CurrentUser) (error, tc.ApiErrorType) {
rollbackTransaction := true
tx, err := db.Beginx()
defer func() {
Expand Down

0 comments on commit e08cd94

Please sign in to comment.