AdminAPI: add date to users
authorAlex Gleason <alex@alexgleason.me>
Wed, 14 Jul 2021 04:51:32 +0000 (23:51 -0500)
committerAlex Gleason <alex@alexgleason.me>
Wed, 14 Jul 2021 13:54:59 +0000 (08:54 -0500)
lib/pleroma/web/admin_api/views/account_view.ex
test/pleroma/web/admin_api/controllers/user_controller_test.exs

index d7c63d385d803b52af1bd6c2f676d4302922acaf..022e9748981988c1b04c47eb2f7deac1d3e49f8f 100644 (file)
@@ -8,6 +8,7 @@ defmodule Pleroma.Web.AdminAPI.AccountView do
   alias Pleroma.User
   alias Pleroma.Web.AdminAPI
   alias Pleroma.Web.AdminAPI.AccountView
+  alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.MastodonAPI
   alias Pleroma.Web.MediaProxy
 
@@ -81,7 +82,8 @@ defmodule Pleroma.Web.AdminAPI.AccountView do
       "is_approved" => user.is_approved,
       "url" => user.uri || user.ap_id,
       "registration_reason" => user.registration_reason,
-      "actor_type" => user.actor_type
+      "actor_type" => user.actor_type,
+      "created_at" => CommonAPI.Utils.to_masto_date(user.inserted_at)
     }
   end
 
index beb8a5d58c454b02af963fd9ea4657afe7557b47..6c410e94c7b0f8a6b04df83c75ab4df0879830f8 100644 (file)
@@ -907,7 +907,8 @@ defmodule Pleroma.Web.AdminAPI.UserControllerTest do
       "is_approved" => true,
       "url" => user.ap_id,
       "registration_reason" => nil,
-      "actor_type" => "Person"
+      "actor_type" => "Person",
+      "created_at" => CommonAPI.Utils.to_masto_date(user.inserted_at)
     }
     |> Map.merge(attrs)
   end