diff options
Diffstat (limited to 'lib/matrix_app_service_web/controllers/v1/user_controller.ex')
-rw-r--r-- | lib/matrix_app_service_web/controllers/v1/user_controller.ex | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/matrix_app_service_web/controllers/v1/user_controller.ex b/lib/matrix_app_service_web/controllers/v1/user_controller.ex index 31301d2..2f73ad7 100644 --- a/lib/matrix_app_service_web/controllers/v1/user_controller.ex +++ b/lib/matrix_app_service_web/controllers/v1/user_controller.ex @@ -1,7 +1,14 @@ defmodule MatrixAppServiceWeb.V1.UserController do use MatrixAppServiceWeb, :controller - def show(conn, _params) do - send_resp(conn, 404, "") + def show(conn, %{"user_id" => user_id}) do + adapter = Application.fetch_env!(:matrix_app_service, :user_adapter) + + with :ok <- adapter.query_user(user_id) do + send_resp(conn, 200, "{}") + else + _ -> + send_resp(conn, 404, "") + end end end |