rnewson commented on a change in pull request #1480: add partition endpoint for 
views
URL: https://github.com/apache/couchdb/pull/1480#discussion_r206823049
 
 

 ##########
 File path: src/chttpd/src/chttpd_db.erl
 ##########
 @@ -250,20 +251,62 @@ handle_view_cleanup_req(Req, Db) ->
     ok = fabric:cleanup_index_files_all_nodes(Db),
     send_json(Req, 202, {[{ok, true}]}).
 
+handle_partition_design_req(#httpd{
+        path_parts=[_DbName, <<"_partition">>, PartitionKey, _Design, Name, 
<<"_",_/binary>> = Action | _Rest]
+    }=Req, Db) -> 
+    DbName = mem3:dbname(couch_db:name(Db)),
+    case mem3:is_partitioned(DbName) of
+        false -> throw(<<"Database is not partitioned">>);
 
 Review comment:
   this will be a 500 Server Error? I think you need a different shape to get a 
400 Bad Request.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to