refactor: api integrate for NEFT,RTGS.IMPS and account statement
This commit is contained in:
@@ -19,6 +19,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
||||
async function handleLogout(e: React.FormEvent) {
|
||||
e.preventDefault();
|
||||
localStorage.removeItem("access_token");
|
||||
localStorage.removeItem("remitter_name");
|
||||
router.push("/login");
|
||||
}
|
||||
|
||||
@@ -41,12 +42,14 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
||||
autoClose: 5000,
|
||||
});
|
||||
localStorage.removeItem("access_token");
|
||||
localStorage.removeItem("remitter_name");
|
||||
return;
|
||||
}
|
||||
const data = await response.json();
|
||||
if (response.ok && Array.isArray(data)) {
|
||||
if (data.length > 0) {
|
||||
const name = data[0].custname;
|
||||
localStorage.setItem("remitter_name", name);
|
||||
setCustname(name);
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user