Permalink
Browse files

PUT with new_edits=false should return JSON body like regular PUT

  • Loading branch information...
1 parent b620e12 commit 6728a6c6672d828be55ab2659c923d87c4377b5b @snej snej committed Mar 23, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 Source/TDRouter+Handlers.m
@@ -823,7 +823,13 @@ - (TDStatus) do_PUT: (TD_Database*)db docID: (NSString*)docID {
if (!$equal(rev.docID, docID) || !rev.revID)
return kTDStatusBadID;
NSArray* history = [TD_Database parseCouchDBRevisionHistory: body.properties];
- return [_db forceInsert: rev revisionHistory: history source: nil];
+ TDStatus status = [_db forceInsert: rev revisionHistory: history source: nil];
+ if (!TDStatusIsError(status)) {
+ _response.bodyObject = $dict({@"ok", $true},
+ {@"id", rev.docID},
+ {@"rev", rev.revID});
+ }
+ return status;
}
}];
}

0 comments on commit 6728a6c

Please sign in to comment.