defmodule Panacea.Sites.Validations.ValidateHostname do
use Ash.Resource.Validation
alias Ash.Error.Changes.InvalidAttribute
alias Ash.Changeset
@impl true
def init(opts), do: {:ok, opts}
@impl true
@spec validate(Changeset.t(), Keyword.t()) :: :ok | {:error, term()}
def validate(changeset, keyword) do
IO.inspect(changeset)
IO.inspect(keyword)
# always return an error because i am trying to see it
{:error,
InvalidAttribute.exception(
message: "hello i am an error if you cannot see me that is a bigger error"
)}
end
end
defmodule Panacea.Sites.Validations.ValidateHostname do
use Ash.Resource.Validation
alias Ash.Error.Changes.InvalidAttribute
alias Ash.Changeset
@impl true
def init(opts), do: {:ok, opts}
@impl true
@spec validate(Changeset.t(), Keyword.t()) :: :ok | {:error, term()}
def validate(changeset, keyword) do
IO.inspect(changeset)
IO.inspect(keyword)
# always return an error because i am trying to see it
{:error,
InvalidAttribute.exception(
message: "hello i am an error if you cannot see me that is a bigger error"
)}
end
end