Somehow fixed the repo insert [skip-ci]

This commit is contained in:
Karen Konou 2019-02-07 23:44:30 +01:00
parent 7e3ec93ed0
commit c43f414a79
2 changed files with 4 additions and 3 deletions

View file

@ -14,7 +14,8 @@ defmodule Pleroma.Web.ThreadMute do
def add_mute(user, id) do def add_mute(user, id) do
%{data: %{"context" => context}} = Activity.get_by_id(id) %{data: %{"context" => context}} = Activity.get_by_id(id)
Repo.insert(%Pleroma.Web.ThreadMute{}, %{user_id: user.id, context: context}) mute = %Pleroma.Web.ThreadMute{user_id: user.id, context: context}
Repo.insert(mute)
end end
def remove_mute(user, id) do def remove_mute(user, id) do

View file

@ -3,10 +3,10 @@ defmodule Pleroma.Repo.Migrations.CreateThreadMutes do
def change do def change do
create table(:thread_mutes) do create table(:thread_mutes) do
add :user, references(:users, type: :uuid, on_delete: :delete_all) add :user_id, references(:users, type: :uuid, on_delete: :delete_all)
add :context, :string add :context, :string
end end
create index(:thread_mutes, [:user]) create index(:thread_mutes, [:user_id])
end end
end end