feat: implement HttpServer for API requests and add getUser function for user profile retrieval
This commit is contained in:
@@ -35,20 +35,16 @@ export const FormLogin = () => {
|
||||
const { handleSubmit } = formMethods
|
||||
|
||||
useEffect(() => {
|
||||
if (fetcher.state !== 'idle' || fetcher.data?.success) {
|
||||
setDisabled(true)
|
||||
if (!fetcher.data?.success) {
|
||||
setError(fetcher.data?.message)
|
||||
setDisabled(false)
|
||||
return
|
||||
}
|
||||
setDisabled(false)
|
||||
}, [fetcher])
|
||||
|
||||
useEffect(() => {
|
||||
if (fetcher.data?.success) {
|
||||
setIsInitSubscribeOpen(true)
|
||||
setIsLoginOpen(false)
|
||||
return
|
||||
}
|
||||
setError(fetcher.data?.message)
|
||||
setDisabled(true)
|
||||
setError(undefined)
|
||||
setIsInitSubscribeOpen(true)
|
||||
setIsLoginOpen(false)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [fetcher])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user