Made file uploads display in drafts
This commit is contained in:
@@ -13,7 +13,7 @@ defmodule Mixer.Posts.MediaUploader do
|
||||
def storage_dir(_version, {_file, scope}), do: "uploads/media/#{scope.id}"
|
||||
|
||||
def filename(_version, {file, _scope}) do
|
||||
Path.basename(file.file_name, Path.extname(file.file_name))
|
||||
Path.basename(file.file_name)
|
||||
end
|
||||
|
||||
def s3_object_headers(_version, {file, _scope}) do
|
||||
|
||||
@@ -42,8 +42,8 @@ defmodule Mixer.Posts.Tweet do
|
||||
Ash.Changeset.after_action(changeset, fn _changeset, tweet ->
|
||||
Mixer.Posts.Media
|
||||
|> Ash.get!(media_id, authorize?: false)
|
||||
|> Ash.Changeset.for_update(:link_to_tweet, %{tweet_id: tweet.id})
|
||||
|> Ash.update!(actor: context.actor)
|
||||
|> Ash.Changeset.for_update(:link_to_tweet, %{tweet_id: tweet.id}, actor: context.actor)
|
||||
|> Ash.update!()
|
||||
|
||||
{:ok, tweet}
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user