diff options
Diffstat (limited to 'shardweb/lib/controllers/identity_controller.ex')
-rw-r--r-- | shardweb/lib/controllers/identity_controller.ex | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/shardweb/lib/controllers/identity_controller.ex b/shardweb/lib/controllers/identity_controller.ex index 3c04fe8..dd254bb 100644 --- a/shardweb/lib/controllers/identity_controller.ex +++ b/shardweb/lib/controllers/identity_controller.ex @@ -10,7 +10,19 @@ defmodule ShardWeb.IdentityController do end def view(conn, %{"pk" => pk}) do - #TODO + {:ok, pk} = Base.decode16(pk) + shard = %SApp.Identity.Manifest{pk: pk} |> SData.term_hash + pid = Shard.Manager.find_proc shard + + if pid == nil do + render conn, ShardWeb.ErrorView, "404.html" + else + render conn, "view.html", + view_pk: pk, + view_nick: SApp.Identity.get_nick(pk), + shard: shard, + pid: pid + end end def update(conn, params) do |