Skip to content

Commit

Permalink
Merge pull request #53 from jortel/watch-detail
Browse files Browse the repository at this point in the history
Fix detail=1 in initial CREATED watch listing.
  • Loading branch information
jortel authored Mar 23, 2021
2 parents 821d6c9 + fddb6fa commit c2fa5a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/inventory/model/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ func (r *Client) Watch(model Model, handler EventHandler) (*Watch, error) {
return nil, err
}
listPtr := reflect.New(reflect.SliceOf(mt))
err = Table{r.db}.List(listPtr.Interface(), ListOptions{})
err = Table{r.db}.List(
listPtr.Interface(),
ListOptions{Detail: 1})
if err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions pkg/inventory/model/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ func TestWatch(t *testing.T) {
object := &TestObject{
ID: i,
Name: "Elmer",
D4: "d4",
}
err = DB.Insert(object)
g.Expect(err).To(gomega.BeNil())
Expand Down

0 comments on commit c2fa5a2

Please sign in to comment.