Skip to content

Commit

Permalink
OP-23068: BugFix- Implemented code changes to handle 304 statauscode …
Browse files Browse the repository at this point in the history
…for BulkImport Api
  • Loading branch information
emanipravallika committed Jan 21, 2025
1 parent a6998cc commit 1e85ae3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ class OpsmxAuditServiceController {
Object bulkImportAcctEnvironmentMappings(@RequestParam("file") MultipartFile data) {
try {
def response = uploadToAuditService(data)
if (response == "All records are duplicates.") {
return ResponseEntity.status(HttpStatus.NOT_MODIFIED).body(response) // Sends 304 status
}
return ResponseEntity.ok(response)
} catch (OesRequestException e) {
log.error("Audit service request failed: {}", e.message, e)
Expand All @@ -109,7 +112,7 @@ class OpsmxAuditServiceController {
}.call() as okhttp3.Response
if (obj.code() == 304) {
log.info("No changes to process: {}", obj.body()?.string())
return "No changes were made. All records are duplicates."
return "All records are duplicates."
}
if (!obj.isSuccessful()) {
def errorBody = obj.body()?.string();
Expand Down

0 comments on commit 1e85ae3

Please sign in to comment.