Merge branch 'remake-remodel-2' of git.pleroma.social:pleroma/pleroma into remake...
[akkoma] / lib / pleroma / web / activity_pub / object_validators / create_validator.ex
index bd90f7250d376d0f47d53be5de7b2401e55aeef7..926804ce74c18311fbf0516e9ea8ae7a21245b75 100644 (file)
@@ -1,19 +1,19 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.ActivityPub.ObjectValidators.CreateNoteValidator do
   use Ecto.Schema
 
-  alias Pleroma.Web.ActivityPub.ObjectValidators.Types
   alias Pleroma.Web.ActivityPub.ObjectValidators.NoteValidator
+  alias Pleroma.Web.ActivityPub.ObjectValidators.Types
 
   import Ecto.Changeset
 
   @primary_key false
 
   embedded_schema do
-    field(:id, :string, primary_key: true)
+    field(:id, Types.ObjectID, primary_key: true)
     field(:actor, Types.ObjectID)
     field(:type, :string)
     field(:to, {:array, :string})
@@ -25,7 +25,6 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.CreateNoteValidator do
   end
 
   def cast_data(data) do
-    %__MODULE__{}
-    |> cast(data, __schema__(:fields))
+    cast(%__MODULE__{}, data, __schema__(:fields))
   end
 end