From 7e7cb12e015dc1560d20fe4499d215b33abe5949 Mon Sep 17 00:00:00 2001 From: "tomosa.sarkar" Date: Wed, 29 Oct 2025 16:03:03 +0530 Subject: [PATCH] fix : X header add for E mandate --- src/app/_util/otp.ts | 4 ++-- src/app/eMandate/login/page.tsx | 19 ++++++++++++++----- src/app/eMandate/mandate_page/page.tsx | 8 ++++---- src/app/login/page.tsx | 8 ++++---- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/app/_util/otp.ts b/src/app/_util/otp.ts index 0e1fc67..7a70463 100644 --- a/src/app/_util/otp.ts +++ b/src/app/_util/otp.ts @@ -14,8 +14,8 @@ interface SendOtpPayload { } function getStoredMobileNumber(): string { - // const mobileNumber = localStorage.getItem('remitter_mobile_no'); - const mobileNumber = "7890544527"; + const mobileNumber = localStorage.getItem('remitter_mobile_no'); + // const mobileNumber = "7890544527"; if (!mobileNumber) throw new Error('Mobile number not found.'); return mobileNumber; } diff --git a/src/app/eMandate/login/page.tsx b/src/app/eMandate/login/page.tsx index 45e0f38..558b6a0 100644 --- a/src/app/eMandate/login/page.tsx +++ b/src/app/eMandate/login/page.tsx @@ -1,7 +1,7 @@ "use client"; -import React, { useState, useEffect } from "react"; -import { Text, Button, TextInput, PasswordInput, Title, Card, Group, Flex, Box, Image, Anchor, Tooltip, Modal, Stack } from "@mantine/core"; +import React, { useState, useEffect, Suspense } from "react"; +import { Text, Button, TextInput, PasswordInput, Title, Card, Group, Box, Image } from "@mantine/core"; import { notifications } from "@mantine/notifications"; import { Providers } from "@/app/providers"; import { useRouter } from "next/navigation"; @@ -13,7 +13,7 @@ import styles from './Login.module.css'; import { useSearchParams } from "next/navigation"; -export default function Login() { +function LoginEmandate() { const router = useRouter(); const [CIF, SetCIF] = useState(""); const [psw, SetPsw] = useState(""); @@ -26,7 +26,7 @@ export default function Login() { useEffect(() => { if (data) { console.log("URL parameter 'data':", data); - localStorage.setItem("Emendate_data",data); + localStorage.setItem("Emendate_data", data); } }, [data]); @@ -99,7 +99,7 @@ export default function Login() { method: 'POST', headers: { 'Content-Type': 'application/json', - 'X-Login-Type': 'emandate', + 'X-Login-Type': 'eMandate', }, body: JSON.stringify({ customerNo: CIF, @@ -376,3 +376,12 @@ export default function Login() { ); } + +export default function Login() { + return ( + Loading...}> + + + ); +} + diff --git a/src/app/eMandate/mandate_page/page.tsx b/src/app/eMandate/mandate_page/page.tsx index 4d6e6be..0da4938 100644 --- a/src/app/eMandate/mandate_page/page.tsx +++ b/src/app/eMandate/mandate_page/page.tsx @@ -127,7 +127,7 @@ export default function MandatePage() { method: "GET", headers: { "Content-Type": "application/json", - 'X-Login-Type': 'emandate', + 'X-Login-Type': 'eMandate', Authorization: `Bearer ${token}`, }, }); @@ -182,7 +182,7 @@ export default function MandatePage() { method: "POST", headers: { "Content-Type": "application/json", - 'X-Login-Type': 'emandate', + 'X-Login-Type': 'eMandate', }, body: JSON.stringify({ mobileNumber: localStorage.getItem("userMobNo"), @@ -220,7 +220,7 @@ export default function MandatePage() { try { const response = await fetch("/api/otp/send", { method: "POST", - headers: { "Content-Type": "application/json",'X-Login-Type': 'emandate' }, + headers: { "Content-Type": "application/json",'X-Login-Type': 'eMandate' }, body: JSON.stringify({ mobileNumber: localStorage.getItem("userMobNo"), type: "EMandate", @@ -264,7 +264,7 @@ export default function MandatePage() { method: "POST", headers: { "Content-Type": "application/json", - 'X-Login-Type': 'emandate', + 'X-Login-Type': 'eMandate', }, body: JSON.stringify({ otp: otp, diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 7341ca1..8c4526a 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -45,8 +45,8 @@ export default function Login() { } try { - // await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: mobile }); - await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: "7890544527" }); + await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: mobile }); + // await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: "7890544527" }); notifications.show({ color: 'orange', title: 'OTP Required', @@ -67,8 +67,8 @@ export default function Login() { async function handleVerifyOtp(mobile?: string) { try { if (mobile) { - // await verifyLoginOtp(otp, mobile); - await verifyLoginOtp(otp, '7890544527'); + await verifyLoginOtp(otp, mobile); + // await verifyLoginOtp(otp, '7890544527'); return true; } }