From 1b922f7319f821fe3daf302a8c68131aaa94f586 Mon Sep 17 00:00:00 2001 From: neodarz Date: Fri, 6 Sep 2019 18:04:40 +0200 Subject: Change code to use Restbed --- db/uobject.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'db') diff --git a/db/uobject.cpp b/db/uobject.cpp index 6401307..25b13e6 100644 --- a/db/uobject.cpp +++ b/db/uobject.cpp @@ -103,8 +103,10 @@ std::string uobject::remove(std::string collection, std::string oid, struct json json_object_object_add(json_id, "$oid", json_oid); json_object_object_add(jsonObject, "_id", json_id); json_object_object_add(jsonObject, "datas", {}); + return json_object_to_json_string_ext(jsonObject, JSON_C_TO_STRING_SPACED | JSON_C_TO_STRING_PRETTY); + } else { + return "0"; } - return json_object_to_json_string_ext(jsonObject, JSON_C_TO_STRING_SPACED | JSON_C_TO_STRING_PRETTY); } std::string uobject::searchKeyValue(std::string collection, std::string key, std::string value, struct json_object* jsonArray) { -- cgit v1.2.1