Skip to content

Commit

Permalink
Merge pull request #129 from michaelborn/patch/handle-response-wrong-…
Browse files Browse the repository at this point in the history
…argument-type

🐛 FIX: Correct wrong type error when deleteByID() tries to delegate error handling to onResponseFailure
  • Loading branch information
jclausen authored Jun 20, 2023
2 parents 9b4b77c + af3931e commit 4abf876
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name":"Elasticsearch for the Coldbox Framework",
"author":"Ortus Solutions <[email protected]",
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbelasticsearch/@build.version@/[email protected]@[email protected]@.zip",
"version":"3.1.4",
"version":"3.2.0",
"slug":"cbelasticsearch",
"type":"modules",
"homepage":"https://cbelasticsearch.ortusbooks.com",
Expand Down
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
----
## [Unreleased]

## [3.1.3] - 06-08-2023
## [3.2.1] - 06-20-2023
### Fixed
* Corrected a typing error when performing error handling in `deleteById()`

## [3.2.0] - 06-08-2023
### Added
* [Added `getTermVectors` to SearchBuilder and Client](https://cbelasticsearch.ortusbooks.com/searching/search#term-vectors) to allow for fetching term vectors on document field(s)

Expand Down
5 changes: 3 additions & 2 deletions models/io/HyperClient.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1031,10 +1031,11 @@ component accessors="true" threadSafe singleton {
deleteRequest.setQueryParam( param.name, param.value );
} );

var deleteResult = deleteRequest.send().json();
var response = deleteRequest.send();
var deleteResult = response.json();

if ( arguments.throwOnError && structKeyExists( deleteResult, "error" ) ) {
onResponseFailure( deleteResult );
onResponseFailure( response );
}

return deleteResult.keyExists( "error" ) ? false : deleteResult.result == "deleted";
Expand Down

0 comments on commit 4abf876

Please sign in to comment.