The Item.create_item_with_tag function will return {:ok, item} or {:error, changeset}.
Currently we are not checking if an error occurs.
We can test this by creating an item where the text only container spaces. The item it not created but the user doesn't get any feedback.
I'm going to look at adding the changeset to the form.
This will also help me once the changeset is linked to the form with #201 as I will be able to add tags dynamically to the changeset when selected.
https://github.com/dwyl/mvp/blob/91d76ecf8d08dd85c452b768f9d3143432158573/lib/app_web/live/app_live.ex#L34-L46
The
Item.create_item_with_tag
function will return{:ok, item}
or{:error, changeset}
. Currently we are not checking if an error occurs. We can test this by creating an item where the text only container spaces. The item it not created but the user doesn't get any feedback.I'm going to look at adding the changeset to the form. This will also help me once the changeset is linked to the form with #201 as I will be able to add tags dynamically to the changeset when selected.