f90089e1bf
Use Upload Media logic from Pleroma Backend changes for picture upload Move AS <-> Model conversion to separate module Front changes Downgrade apollo-client: https://github.com/Akryum/vue-apollo/issues/577 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
23 lines
417 B
Elixir
23 lines
417 B
Elixir
defmodule Mobilizon.Media.File do
|
|
@moduledoc """
|
|
Represents a file entity
|
|
"""
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
embedded_schema do
|
|
field(:name, :string)
|
|
field(:url, :string)
|
|
field(:content_type, :string)
|
|
|
|
timestamps()
|
|
end
|
|
|
|
@doc false
|
|
def changeset(picture, attrs) do
|
|
picture
|
|
|> cast(attrs, [:name, :url, :content_type])
|
|
|> validate_required([:name, :url])
|
|
end
|
|
end
|