diff --git a/docu/login_server.api.md b/docu/login_server.api.md index 49a390c3a..7932ec42e 100644 --- a/docu/login_server.api.md +++ b/docu/login_server.api.md @@ -81,4 +81,30 @@ data: {"session_id": -127182} Wenn alles okay ist erhältst du: ```json {"state":"success"} -``` \ No newline at end of file +``` + +## Update User Data +Update first name, last name, user language and enable/disable user +Language currently supported de and en +User will be disabled if he wants a account delete but has transactions. +Until transactions are saved in real blockchain, we need this data because the public key +is in db only saved in state_users so we wenn delete this entry, validating all transactions not longer possible. +Disabled User cannot login and cannot receive transactions. +In update Object only one of the sets needs to be there. + +POST http://localhost/login_api/updateUserInfos +```json +{"session_id": -127182, "email": "max.musterman@gmail.de", "update": { + "User.first_name": "Dario", + "User.last_name" : "Rekowski", + "User.disabled": 0, + "User.language": "de" +}} +``` +also valid +```json +{"session_id": -127182, "email": "max.musterman@gmail.de", "update": { + "User.last_name" : "Rekowski" +}} +``` + \ No newline at end of file diff --git a/login_server/src/cpp/JSONInterface/JsonGetLogin.cpp b/login_server/src/cpp/JSONInterface/JsonGetLogin.cpp index 67d963648..11bdb398e 100644 --- a/login_server/src/cpp/JSONInterface/JsonGetLogin.cpp +++ b/login_server/src/cpp/JSONInterface/JsonGetLogin.cpp @@ -71,15 +71,13 @@ Poco::JSON::Object* JsonGetLogin::handle(Poco::Dynamic::Var params) em->addError(new Error("JsonGetLogin::handle", "generic exception calling userModel->getJson: ")); em->sendErrorsAsEmail(); } - // use both variants for compatibility reasons, but final version is Transactions.pending - result->set("Transaction.pending", session->getProcessingTransactionCount()); + result->set("Transactions.pending", session->getProcessingTransactionCount()); auto executing = observer->getTaskCount(userModel->getEmail(), TASK_OBSERVER_SIGN_TRANSACTION); if (executing < 0) { executing = 0; } - // use both variants for compatibility reasons, but final version is Transactions.executing - result->set("Transaction.executing", executing); + result->set("Transactions.executing", executing); //printf("pending: %d\n", session->getProcessingTransactionCount()); //std::string user_string = userModel->toString();