It consumes a mockAPI generated automatically with the ToDo's the user register inside the app. To see it follow the steps below:
- Open the application
- Click on the plus button on the top of the screen,
- Write a to do item (you can leave the completed field the way you want)
- Click on "save" on the top of the screen
- Stop the application and run again, this step will print in the console a path
- Copy the path logged in the console,
- Open the finder application
- Use the shortcut Command + Shift + G and paste the path you copied earlier
- Open the file named: "mockAPI.json"
obs.: I made it like that, because now to use a real API, just need to change the place where it calls this file and put the API call.
The validation of the Input is on demand, disabling the save button if the input field has nothing written.
The error handling you can check by changing the mock API file.
To test this follow the steps:
- Open the mockAPI file again
- Change the "id" field to "id1"
- Save the file
- Run the application