mirror of
https://github.com/typesense/typesense.git
synced 2025-05-16 11:28:44 +08:00
Fix num_documents
& facet
fields not returned when creating a new collection.
This commit is contained in:
parent
6ab5514af0
commit
6cdbb29d4a
@ -32,7 +32,7 @@ public:
|
||||
return is_ok;
|
||||
}
|
||||
|
||||
T get() {
|
||||
T get() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
11
src/api.cpp
11
src/api.cpp
@ -120,8 +120,15 @@ void post_create_collection(http_req & req, http_res & res) {
|
||||
}
|
||||
|
||||
const std::string & default_sorting_field = req_json[DEFAULT_SORTING_FIELD].get<std::string>();
|
||||
collectionManager.create_collection(req_json["name"], fields, default_sorting_field);
|
||||
res.send_201(req.body);
|
||||
const Option<Collection*> & collection_op =
|
||||
collectionManager.create_collection(req_json["name"], fields, default_sorting_field);
|
||||
|
||||
if(collection_op.ok()) {
|
||||
nlohmann::json json_response = collection_summary_json(collection_op.get());
|
||||
return res.send_201(json_response.dump());
|
||||
}
|
||||
|
||||
return res.send(collection_op.code(), collection_op.error());
|
||||
}
|
||||
|
||||
void del_drop_collection(http_req & req, http_res & res) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user