Skip to content

Commit 7d1c609

Browse files
authored
Merge pull request #10 from couchbase-examples/DEVADV-1515-scala-tutorial
Backport Scala fixes to Java tutorial.
2 parents d3640e5 + 07189e9 commit 7d1c609

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main/java/org/couchbase/quickstart/controllers/ProfileController.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,12 @@ public ResponseEntity<Profile> getProfile(@PathVariable("id") UUID id) {
7676
@ApiOperation(value = "Update a user profile", response = Profile.class)
7777
@ApiResponses({
7878
@ApiResponse(code = 201, message = "Updated the user profile", response = Profile.class),
79-
@ApiResponse(code = 404, message = "User profile not found", response = Error.class),
8079
@ApiResponse(code = 500, message = "Internal Server Error", response = Error.class)
8180
})
8281
public ResponseEntity<Profile> update(@PathVariable("id") UUID id, @RequestBody Profile profile) {
8382
try {
84-
profileCol.replace(id.toString(), profile);
83+
profileCol.upsert(id.toString(), profile);
8584
return ResponseEntity.status(HttpStatus.CREATED).body(profile);
86-
} catch (DocumentNotFoundException dnfe) {
87-
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
8885
} catch (Exception e){
8986
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
9087
}

0 commit comments

Comments
 (0)