Skip to content

Commit

Permalink
change the deleteAssertion to the new RESTful endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
brucehyslop committed May 4, 2023
1 parent d07186a commit b9d088c
Showing 1 changed file with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,26 @@ class WebServicesService {
* @param assertionUuid
* @return
*/
def Map deleteAssertion(String recordUuid, String assertionUuid) {
Map postBody = [
recordUuid : recordUuid,
assertionUuid: assertionUuid
]
Map deleteAssertion(String recordUuid, String assertionUuid) {

String url = grailsApplication.config.getProperty('biocache.baseUrl') + "/occurrences/${recordUuid}/assertions/${assertionUuid}"

Map result = webService.delete(url, [:], ContentType.APPLICATION_JSON, true, true)

Map postResponse = [:]

postResponse.statusCode = result.statusCode

if (result.error) {

postResponse.statusMsg = result.error

} else {

postResponse.statusMsg = ''
}

postFormData(grailsApplication.config.biocache.baseUrl + "/occurrences/assertions/delete", postBody, true, true)
return postResponse
}

@Cacheable('collectoryCache')
Expand Down

0 comments on commit b9d088c

Please sign in to comment.