Skip to content

Commit

Permalink
Merge pull request #19 from cabify/fix-bulk-get
Browse files Browse the repository at this point in the history
Fix BulkGet request body
  • Loading branch information
Mario authored Oct 14, 2020
2 parents 67a7635 + 2936a12 commit 81cac75
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
### Security
- Nothing

## [0.4.1] - 2020-08-03
### Fixed
- Fix BulkGet request body

## [0.4.0] - 2020-08-03
### Added
- BulkDocs method
Expand All @@ -38,4 +42,4 @@

## [0.1.0] - 2020-06-19
### Added
- First release to be compatible with go modules
- First release to be compatible with go modules
2 changes: 1 addition & 1 deletion bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type bulkID struct {
}

type BulkGet struct {
Docs []struct{ ID string } `json:"docs"`
Docs []bulkID `json:"docs"`
}

type BulkDocsReq struct {
Expand Down
2 changes: 1 addition & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (db *DB) BulkGet(ids []string, docType interface{}, opts Options) (docs []i

request := &BulkGet{}
for _, id := range ids {
request.Docs = append(request.Docs, struct{ ID string }{ID: id})
request.Docs = append(request.Docs, bulkID{ID: id})
}

bodyJson, err := json.Marshal(request)
Expand Down

0 comments on commit 81cac75

Please sign in to comment.