Merge pull request 'set first photo to featured' (#216) from devel into main
Reviewed-on: #216
This commit is contained in:
commit
d994a14f54
1 changed files with 5 additions and 2 deletions
|
@ -16,10 +16,13 @@ defmodule ChiyaWeb.Indie.Micropub do
|
||||||
# TODO: Make separate function for this
|
# TODO: Make separate function for this
|
||||||
properties
|
properties
|
||||||
|> Props.get_photos()
|
|> Props.get_photos()
|
||||||
|> Enum.map(fn photo ->
|
|> Enum.with_index()
|
||||||
|
|> Enum.map(fn {photo, index} ->
|
||||||
|
featured = index == 0
|
||||||
Chiya.Notes.create_note_image(%{
|
Chiya.Notes.create_note_image(%{
|
||||||
note_id: note.id,
|
note_id: note.id,
|
||||||
path: photo.path
|
path: photo.path,
|
||||||
|
featured: featured
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|> Enum.each(fn result ->
|
|> Enum.each(fn result ->
|
||||||
|
|
Loading…
Reference in a new issue