- Multi.new()
- |> Multi.update(:update, changeset(notification, %{seen: true}))
- |> Marker.multi_set_last_read_id(user, "notifications")
- |> Repo.transaction()
- |> case do
- {:ok, %{update: notification}} -> {:ok, notification}
- {:error, :update, changeset, _} -> {:error, changeset}
- end