From 7df19883b1f82ae840624821cd131f1d232acdfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20N=C3=BDvlt?= Date: Fri, 9 Aug 2024 14:34:25 +0200 Subject: [PATCH] FIx reassignment --- lib/chore_tracker/chores.ex | 2 +- lib/chore_tracker_web/components/layouts/root.html.heex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/chore_tracker/chores.ex b/lib/chore_tracker/chores.ex index 6a26587..3bacb2e 100644 --- a/lib/chore_tracker/chores.ex +++ b/lib/chore_tracker/chores.ex @@ -27,7 +27,7 @@ defmodule ChoreTracker.Chores do def update_chore(%Chore{} = chore, attrs) do Ecto.Multi.new() |> Ecto.Multi.update(:chore, change_chore(chore, attrs)) - |> Ecto.Multi.run(:update_next_assignee, fn _repo, _changeset -> + |> Ecto.Multi.run(:update_next_assignee, fn _repo, %{chore: chore} -> save_next_chore_assignee(chore) end) |> Repo.transaction() diff --git a/lib/chore_tracker_web/components/layouts/root.html.heex b/lib/chore_tracker_web/components/layouts/root.html.heex index 4552ce7..bd4c870 100644 --- a/lib/chore_tracker_web/components/layouts/root.html.heex +++ b/lib/chore_tracker_web/components/layouts/root.html.heex @@ -1,5 +1,5 @@ - +