fix login styling

This commit is contained in:
NCanggoro 2023-10-03 14:39:54 +07:00
parent 1fe205165d
commit cdb3fa2955
2 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
input { td input {
padding: 5px; padding: 5px;
font-size: 14px; font-size: 14px;
} }

View File

@ -24,12 +24,13 @@ function Login() {
e.preventDefault(); e.preventDefault();
try { try {
const res = await loginService({ username: form.username, password: form.password }) const res = await loginService({ username: form.username, password: form.password })
if (res.error.response.status == 400) {
setErrorMsg(res.error.response.data.errors)
return
}
if(res.error) { if(res.error) {
if (res.error.response.status == 400) {
setErrorMsg(res.error.response.data.errors)
return
}
alert(res.error.response.data.message) alert(res.error.response.data.message)
return return
} }
@ -77,7 +78,6 @@ function Login() {
function onChangeInput(e: ChangeEvent<HTMLInputElement>) { function onChangeInput(e: ChangeEvent<HTMLInputElement>) {
const val = e.target as HTMLInputElement; const val = e.target as HTMLInputElement;
setFrom({ ...form, [val.placeholder]: val.value }) setFrom({ ...form, [val.placeholder]: val.value })
} }
return ( return (