~ihabunek/triglav

21fae5517e791ddafd57fa278badc98aaaf2f0ca — Ivan Habunek 9 months ago 29b644d
Add a namespace for custom fields in feed
1 files changed, 4 insertions(+), 3 deletions(-)

M lib/triglav_web/controllers/zet/errors_controller.ex
M lib/triglav_web/controllers/zet/errors_controller.ex => lib/triglav_web/controllers/zet/errors_controller.ex +4 -3
@@ 24,6 24,7 @@ defmodule TriglavWeb.Zet.ErrorsController do
      |> Feed.link(self_url, rel: "self")
      |> Feed.link(base_url, rel: "alternate", type: "text/html")
      |> Feed.entries(Enum.map(history, &to_entry(&1, base_url)))
      |> Feed.build(%{"xmlns:triglav" => "http://triglav.bezdomni.net/atom"})
      |> Atomex.generate_document()

    conn


@@ 59,9 60,9 @@ defmodule TriglavWeb.Zet.ErrorsController do

    Entry.new(id, history_item.timestamp, title)
    |> Entry.content(content, type: "html")
    |> Entry.add_field("counts", counts, nil)
    |> Entry.add_field("osm_sequence_number", nil, history_item.osm_sequence_number)
    |> Entry.add_field("zet_feed_version", nil, history_item.zet_feed_version)
    |> Entry.add_field("triglav:counts", counts, nil)
    |> Entry.add_field("triglav:osm_sequence_number", nil, history_item.osm_sequence_number)
    |> Entry.add_field("triglav:zet_feed_version", nil, history_item.zet_feed_version)
    |> Entry.build()
  end
end