Refactor media upload
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>
This commit is contained in:
@@ -33,6 +33,8 @@ defmodule Mobilizon.Factory do
|
||||
followings: [],
|
||||
keys: pem,
|
||||
type: :Person,
|
||||
avatar: build(:file, name: "Avatar"),
|
||||
banner: build(:file, name: "Banner"),
|
||||
url: Actor.build_url(preferred_username, :page),
|
||||
followers_url: Actor.build_url(preferred_username, :followers),
|
||||
following_url: Actor.build_url(preferred_username, :following),
|
||||
@@ -167,4 +169,18 @@ defmodule Mobilizon.Factory do
|
||||
token: Ecto.UUID.generate()
|
||||
}
|
||||
end
|
||||
|
||||
def file_factory do
|
||||
%Mobilizon.Media.File{
|
||||
name: "My Picture",
|
||||
url: MobilizonWeb.Endpoint.url() <> "/uploads/something",
|
||||
content_type: "image/png"
|
||||
}
|
||||
end
|
||||
|
||||
def picture_factory do
|
||||
%Mobilizon.Media.Picture{
|
||||
file: build(:file)
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user