diff --git a/lib/shift73k/accounts/user.ex b/lib/shift73k/accounts/user.ex index f0f5f036..fe26a322 100644 --- a/lib/shift73k/accounts/user.ex +++ b/lib/shift73k/accounts/user.ex @@ -20,19 +20,19 @@ defmodule Shift73k.Accounts.User do @primary_key {:id, :binary_id, autogenerate: true} @foreign_key_type :binary_id schema "users" do - field(:email, :string) - field(:password, :string, virtual: true) - field(:hashed_password, :string) - field(:confirmed_at, :naive_datetime) - field(:calendar_slug, :string, default: Ecto.UUID.generate()) + field :email, :string + field :password, :string, virtual: true + field :hashed_password, :string + field :confirmed_at, :naive_datetime + field :calendar_slug, :string, default: Ecto.UUID.generate() - field(:role, Ecto.Enum, values: Keyword.keys(@roles), default: :user) - field(:week_start_at, Ecto.Enum, values: weekdays(), default: :monday) + field :role, Ecto.Enum, values: Keyword.keys(@roles), default: :user + field :week_start_at, Ecto.Enum, values: weekdays(), default: :monday - has_many(:shift_templates, ShiftTemplate) - belongs_to(:fave_shift_template, ShiftTemplate) + has_many :shift_templates, ShiftTemplate + belongs_to :fave_shift_template, ShiftTemplate - has_many(:shifts, Shift) + has_many :shifts, Shift timestamps() end diff --git a/lib/shift73k/accounts/user_token.ex b/lib/shift73k/accounts/user_token.ex index a81905bc..625547e1 100644 --- a/lib/shift73k/accounts/user_token.ex +++ b/lib/shift73k/accounts/user_token.ex @@ -15,10 +15,10 @@ defmodule Shift73k.Accounts.UserToken do @primary_key {:id, :binary_id, autogenerate: true} @foreign_key_type :binary_id schema "users_tokens" do - field(:token, :binary) - field(:context, :string) - field(:sent_to, :string) - belongs_to(:user, Shift73k.Accounts.User) + field :token, :binary + field :context, :string + field :sent_to, :string + belongs_to :user, Shift73k.Accounts.User timestamps(updated_at: false) end diff --git a/lib/shift73k/shifts/shift.ex b/lib/shift73k/shifts/shift.ex index 69fcb25c..50384cf8 100644 --- a/lib/shift73k/shifts/shift.ex +++ b/lib/shift73k/shifts/shift.ex @@ -13,7 +13,7 @@ defmodule Shift73k.Shifts.Shift do field :time_start, :time field :time_end, :time - belongs_to(:user, Shift73k.Accounts.User) + belongs_to :user, Shift73k.Accounts.User timestamps() end diff --git a/lib/shift73k/shifts/templates/shift_template.ex b/lib/shift73k/shifts/templates/shift_template.ex index af5bd4f1..56ae8ac5 100644 --- a/lib/shift73k/shifts/templates/shift_template.ex +++ b/lib/shift73k/shifts/templates/shift_template.ex @@ -16,8 +16,8 @@ defmodule Shift73k.Shifts.Templates.ShiftTemplate do field :time_start, :time, default: ~T[09:00:00] field :time_end, :time, default: ~T[17:00:00] - belongs_to(:user, Shift73k.Accounts.User) - has_one(:is_fave_of_user, Shift73k.Accounts.User, foreign_key: :fave_shift_template_id) + belongs_to :user, Shift73k.Accounts.User + has_one :is_fave_of_user, Shift73k.Accounts.User, foreign_key: :fave_shift_template_id timestamps() end diff --git a/lib/shift73k_web/live/user/reset_password.html.heex b/lib/shift73k_web/live/user/reset_password.html.heex index 0abfcea5..7650f451 100644 --- a/lib/shift73k_web/live/user/reset_password.html.heex +++ b/lib/shift73k_web/live/user/reset_password.html.heex @@ -6,7 +6,7 @@
Hi <%= @user.email %> — tell us your new password, please.
- <%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, novalidate: true, id: "pw_reset_form"], fn f -> %> + <.form let={f} for={@changeset} phx-change="validate" phx-submit="save" novalidate id="pw_reset_form"> <%= label f, :password, "New password", class: "form-label" %><%= if allow_registration() do %>