docs: Update constraints.md (#869)

The username is not an argument, i replaced it with the argument title.
This commit is contained in:
Alexander Richard Römpke 2024-02-06 15:45:32 +01:00 committed by GitHub
parent e331e24c7b
commit f7024f2b6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -139,10 +139,10 @@ defmodule MyProject.MyApi.Account do
end
change fn changeset, _ ->
username = Ash.Changeset.get_argument(changeset, :username)
title = Ash.Changeset.get_argument(changeset, :title)
age = Ash.Changeset.get_argument(changeset, :age)
Ash.Changeset.change_attribute(changeset, :username, "#{username}-#{age}")
Ash.Changeset.change_attribute(changeset, :username, "#{title}-#{age}")
end
end
end