Ash 3.0 - Ash.update/1 is throwing an exception at updated_at
column. How do I fix it? I tried several methods without success.
%WithClauseError{term: {:not_atomic, "Failed to validate expression required!(now()): \"data layer does not support the function error(Ash.Error.Changes.Required, %{type: :attribute, resource: Kamaro.Stock.Category, field: :updated_at})\""}}
Here are my codes:
def handle_event("validate", %{"form" => params}, socket) do
form = AshPhoenix.Form.validate(socket.assigns.form, params)
socket
|> assign(:form, form)
|> noreply()
end
def handle_event("save", %{"form" => params}, socket) do
case AshPhoenix.Form.submit(socket.assigns.form, params: params) do
{:ok, item} ->
socket
|> put_flash(:info, "Item saved!")
|> push_navigate(to: ~p"/")
|> noreply()
{:error, form} ->
assign(socket, form: form)
|> noreply()
end
end