change published_at to published

This commit is contained in:
Inhji 2024-12-06 09:44:53 +01:00
parent e1d37bdea0
commit 48346d7fd7
2 changed files with 5 additions and 6 deletions

View file

@ -5,6 +5,6 @@ defmodule PlugIndie.Post do
:like_of, :like_of,
:title, :title,
:type, :type,
:published_at :published
] ]
end end

View file

@ -4,14 +4,13 @@ defmodule PlugIndie.Properties do
content = get_content(properties) content = get_content(properties)
title = get_title(properties) title = get_title(properties)
published = is_published?(properties) published = is_published?(properties)
published_at = if published, do: DateTime.utc_now(), else: nil
case type do case type do
:note -> :note ->
{:ok, {:ok,
%PlugIndie.Post{ %PlugIndie.Post{
type: type, type: type,
published_at: published_at, published: published,
content: content content: content
}} }}
@ -19,7 +18,7 @@ defmodule PlugIndie.Properties do
{:ok, {:ok,
%PlugIndie.Post{ %PlugIndie.Post{
type: type, type: type,
published_at: published_at, published: published,
title: title, title: title,
content: content content: content
}} }}
@ -28,7 +27,7 @@ defmodule PlugIndie.Properties do
{:ok, {:ok,
%PlugIndie.Post{ %PlugIndie.Post{
type: type, type: type,
published_at: published_at, published: published,
title: title, title: title,
content: content, content: content,
bookmark_of: get_bookmarked_url(properties) bookmark_of: get_bookmarked_url(properties)
@ -38,7 +37,7 @@ defmodule PlugIndie.Properties do
{:ok, {:ok,
%PlugIndie.Post{ %PlugIndie.Post{
type: type, type: type,
published_at: published_at, published: published,
like_of: get_liked_url(properties) like_of: get_liked_url(properties)
}} }}