Skip to content

Commit

Permalink
fix(p-error): report parent resource invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudyard Richter committed Jul 25, 2019
1 parent 868f152 commit 9f7be22
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arborist/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ func (resource *ResourceIn) createInDb(tx *sqlx.Tx) *ErrorResponse {
}

func (resource *ResourceIn) createRecursively(tx *sqlx.Tx) *ErrorResponse {
errResponse := resource.validate()
if errResponse != nil {
return errResponse
}
// arborist uses `/` for path separator; ltree in postgres uses `.`
path := formatPathForDb(resource.Path)
stmt := "INSERT INTO resource(path, description) VALUES ($1, $2)"
Expand Down

0 comments on commit 9f7be22

Please sign in to comment.