interceptor error types needed

This commit is contained in:
ntr committed 2022-08-14 22:56:46 +10:00
1 parent b0bca74ee2
commit 7121b2f4cd
4 files changed
+29 -24

No files matched your search

+11 -2
View File
@@ -9,13 +9,22 @@ const Login = ({ success }) => {
const [confirmPassword, setConfirmPassword] = useState('');
async function postLogin() {
const user = await actions.postLogin(email, password);
const [error, user] = await actions.postLogin(email, password);
console.log(error, user);
if (error) return console.warn(error);
success(user);
}
async function postRegister() {
const [error, user] = await actions.postRegister(email, password);
if (error) return console.warn(error);
success(user);
}
function handleSubmit(e) {
e.preventDefault();
postLogin();
if (mode === 'login') return postLogin()
if (mode === 'register') return postRegister();
}
if (mode === 'register') return (