Отже, на виконання завдання відводиться 180 хвилин.
👉 Завдання
Draw a simple user registration form with next fields
1. Email.
2. Password
3. Password Confirmation
All fields are required for submitting. Password and Password Confirmation should match
On submit the call to an API should be performed (see request bellow)
After successful submit, the rating from the response should be displayed on the screen instead of form.
API might return status code 400 with validation errors or 500 with 30% chance. Errors should be handled.
Request example:
fetch('https://react-course-api.azurewebsites.net/user', {body: JSON.stringify({name: 'test', password: '123123', passwordConfirmation: '123123'}), method: 'POST', headers: {
'Content-Type': 'application/json'
}}).then(x=>x.json()).then(console.log);