This repository has been archived on 2023-11-19. You can view files and clone it, but cannot push or open issues or pull requests.
restcrud/lib/events/events.ex
2023-06-02 18:41:02 +02:00

15 lines
296 B
Elixir

defmodule Events.Events do
use Ecto.Schema
import Ecto.Changeset
schema "events" do
field :title, :string
field :payload, :string
end
def changeset(user, params \\ %{}) do
user
|> cast(params, [:title, :payload])
|> validate_required([:title, :payload])
end
end