The project I just joined does not use an API from the backend but must create mock data by itself through the Axios-mock-adapter. I am making a form to change the password, if the inputs entered are correct, submit it will display successfully, if the inputs are not correct, an error will be displayed (eg input is not blank, the password is not matched...) How to do that?
.onPost("/user/changepassword"), {
// How can I pass the values of the inputs
})
.reply(() => {
// How can I check the value of the inputs: empty, password input does not match...
if (conditions are ok) {
return [200, MOCK_RESPONSE.SUCCESS];
} else {
return [200, MOCK_RESPONSE.ERROR];
}
});