fix : X header add for E mandate

This commit is contained in:
2025-10-29 16:03:03 +05:30
parent ded4a2edc9
commit 7e7cb12e01
4 changed files with 24 additions and 15 deletions

View File

@@ -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;
}

View File

@@ -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("");
@@ -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() {
</Providers>
);
}
export default function Login() {
return (
<Suspense fallback={<div>Loading...</div>}>
<LoginEmandate />
</Suspense>
);
}

View File

@@ -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,

View File

@@ -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;
}
}