fix tags
This commit is contained in:
parent
83aac55273
commit
84d879ddc9
1 changed files with 2 additions and 2 deletions
|
@ -67,7 +67,7 @@ defmodule Chiya.Tags.TagUpdater do
|
||||||
Logger.debug("Looking up tag [#{tag}] with slug [#{slug}]")
|
Logger.debug("Looking up tag [#{tag}] with slug [#{slug}]")
|
||||||
|
|
||||||
{:ok, tag} =
|
{:ok, tag} =
|
||||||
case Tags.get_tag(slug) do
|
case Tags.get_tag_by_slug(slug) do
|
||||||
nil ->
|
nil ->
|
||||||
Logger.debug("Tag [#{tag}] does not exist. Creating.")
|
Logger.debug("Tag [#{tag}] does not exist. Creating.")
|
||||||
Tags.create_tag(%{name: tag})
|
Tags.create_tag(%{name: tag})
|
||||||
|
@ -96,7 +96,7 @@ defmodule Chiya.Tags.TagUpdater do
|
||||||
defp remove_tag(schema, tag) do
|
defp remove_tag(schema, tag) do
|
||||||
slug = Slugger.slugify_downcase(tag)
|
slug = Slugger.slugify_downcase(tag)
|
||||||
|
|
||||||
if tag = Tags.get_tag(slug) do
|
if tag = Tags.get_tag_by_slug(slug) do
|
||||||
case schema do
|
case schema do
|
||||||
%Note{} ->
|
%Note{} ->
|
||||||
attrs = %{tag_id: tag.id, note_id: schema.id}
|
attrs = %{tag_id: tag.id, note_id: schema.id}
|
||||||
|
|
Loading…
Reference in a new issue