feat: implement HttpServer for API requests and add getUser function for user profile retrieval

This commit is contained in:
Ardeman
2025-02-28 23:56:47 +08:00
parent 9bc7fbb902
commit 0577975846
5 changed files with 42 additions and 19 deletions
+7 -11
View File
@@ -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])