mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-20 04:14:23 +01:00
Allow user link editing to wipe tag
This commit is contained in:
parent
4c4dc4b5ce
commit
134b684bdd
1 changed files with 8 additions and 0 deletions
|
@ -30,6 +30,14 @@ defmodule Philomena.UserLinks.UserLink do
|
||||||
|> validate_required([])
|
|> validate_required([])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def edit_changeset(user_link, attrs, nil) do
|
||||||
|
user_link
|
||||||
|
|> cast(attrs, [:uri, :public])
|
||||||
|
|> put_change(:tag_id, nil)
|
||||||
|
|> validate_required([:user, :uri, :public])
|
||||||
|
|> parse_uri()
|
||||||
|
end
|
||||||
|
|
||||||
def edit_changeset(user_link, attrs, tag) do
|
def edit_changeset(user_link, attrs, tag) do
|
||||||
user_link
|
user_link
|
||||||
|> cast(attrs, [:uri, :public])
|
|> cast(attrs, [:uri, :public])
|
||||||
|
|
Loading…
Reference in a new issue