From 293bf53258fbed2270a124973bc4fc44e801830c Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Tue, 6 Sep 2022 18:46:55 +0800 Subject: [PATCH] feat: login with not existed username tip --- src/app/services/base.query.ts | 4 +++- src/routes/login/index.tsx | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/services/base.query.ts b/src/app/services/base.query.ts index 99d41517..ca99a660 100644 --- a/src/app/services/base.query.ts +++ b/src/app/services/base.query.ts @@ -97,7 +97,9 @@ const baseQueryWithTokenCheck = async (args, api, extraOptions) => { break; case 404: { - toast.error("Request Not Found"); + if (api.endpoint !== "login") { + toast.error("Request Not Found"); + } } break; case 500: diff --git a/src/routes/login/index.tsx b/src/routes/login/index.tsx index f2c174b3..f98b3313 100644 --- a/src/routes/login/index.tsx +++ b/src/routes/login/index.tsx @@ -64,6 +64,7 @@ export default function LoginPage() { if (error) { switch ((error as FetchBaseQueryError).status) { case 401: + case 404: toast.error("Username or Password incorrect"); break; case 410: