mirror of https://gitee.com/bigwinds/arangodb
simplifications
This commit is contained in:
parent
e03cff939b
commit
70d60e623e
|
@ -38,12 +38,7 @@ var cluster = require("@arangodb/cluster");
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function databasePrefix (req, url) {
|
||||
if (req.hasOwnProperty('compatibility') && req.compatibility < 10400) {
|
||||
// pre 1.4-style location response (e.g. /_api/collection/xyz)
|
||||
return url;
|
||||
}
|
||||
|
||||
// 1.4-style location response (e.g. /_db/dbname/_api/collection/xyz)
|
||||
// location response (e.g. /_db/dbname/_api/collection/xyz)
|
||||
return "/_db/" + encodeURIComponent(arangodb.db._name()) + url;
|
||||
}
|
||||
|
||||
|
|
|
@ -162,8 +162,7 @@ function post_api_database (req, res) {
|
|||
|
||||
var result = arangodb.db._createDatabase(json.name || "", options, users);
|
||||
|
||||
var returnCode = (req.compatibility <= 10400 ? actions.HTTP_OK : actions.HTTP_CREATED);
|
||||
actions.resultOk(req, res, returnCode, { result : result });
|
||||
actions.resultOk(req, res, actions.HTTP_CREATED, { result : result });
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue