aboutsummaryrefslogtreecommitdiff
path: root/src/guff/api/test.cr
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-04-02 01:09:45 -0400
committerPaul Duncan <pabs@pablotron.org>2016-04-02 01:09:45 -0400
commit23ba337de24e88c6aaf6ceb37507997f5c5f4920 (patch)
treef5a6fc8d925dafd62ee45973b4e357234ea9ec9a /src/guff/api/test.cr
parent7788012457346ae59fa58ed35fc08aa2b9e6b9ef (diff)
downloadold-guff-23ba337de24e88c6aaf6ceb37507997f5c5f4920.tar.bz2
old-guff-23ba337de24e88c6aaf6ceb37507997f5c5f4920.zip
fully working edit dialog
Diffstat (limited to 'src/guff/api/test.cr')
-rw-r--r--src/guff/api/test.cr10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/guff/api/test.cr b/src/guff/api/test.cr
index decc5ec..91a729c 100644
--- a/src/guff/api/test.cr
+++ b/src/guff/api/test.cr
@@ -65,14 +65,16 @@ module Guff::API::TestAPI
{ "ok": true, "user_id": user_id }
end
- private def do_test_update_user(
+ private def do_test_edit_user(
context : HTTP::Server::Context,
args : Hash(String, String)
)
- @models.user.update_user(args["user_id"].to_i64,
- name: args["name"]? ? args["name"] : nil,
+ @models.user.edit_user(args["user_id"].to_i64,
+ name: args["name"]?,
active: args["active"]? ? args["active"] == "t" : nil,
- role: args["role"]? ? args["role"] : nil
+ role: args["role"]?,
+ email: args["email"]?,
+ password: args["password"]?,
)
{ "ok": true }