defmodule CMS.Posts do @moduledoc false alias CMS.Posts.Post alias CMS.Repo def create_post(attrs) do %Post{} |> Post.changeset(attrs) |> Repo.insert() end def update_post(post, attrs) do post |> Post.changeset(attrs) |> Repo.update() end def get_post!(id) do Repo.get!(Post, id) end def list_posts do Repo.all(Post) end end