I have to read ''
https://run.mocky.io/v3/e89d089c-8251-4fe4-aa46-7f6e48694b82 'to const loginHandle = (userName, password) => {
const foundUser = Users.filter(item => {
return userName === item.username && password === item.password;
});
if (data.username.length === 0 || data.password.length === 0) {
Alert.alert(
'Wrong Input!',
'Username or password field cannot be empty.',
[{text: 'Okay'}],
);
return;
}
if (foundUser.length === 0) {
Alert.alert('Invalid User!', 'Username or password is incorrect.', [
{text: 'Okay'},
]);
return;
}
signIn(foundUser);
};