refactor: Clean up console logging and improve code formatting in UserAuth and signInApi

This commit is contained in:
Jerald-Golden-B 2025-06-04 15:27:39 +05:30
parent 4eac6c628f
commit 4d738d576a
3 changed files with 4 additions and 11 deletions

View File

@ -41,7 +41,6 @@ const UserAuth: React.FC = () => {
try {
const res = await signInApi(email, password, organization, fingerprint);
console.log('res: ', res);
if (res.message.message === "login successfull") {
setError("");
setOrganization(organization);

View File

@ -1,18 +1,18 @@
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
export const signInApi = async (Email: string,Password: Object,organization: Object,fingerprint:any) => {
export const signInApi = async (Email: string, Password: Object, organization: Object, fingerprint: any) => {
try {
const response = await fetch(`${url_Backend_dwinzo}/api/V1/Auth/login`, {
method: "POST",
headers: {"Content-Type": "application/json",},
body: JSON.stringify({ Email, Password, organization,fingerprint}),
headers: { "Content-Type": "application/json", },
body: JSON.stringify({ Email, Password, organization, fingerprint }),
});
const result = await response.json();
return result;
} catch (error) {
echo.error("Failed to sign-in");
echo.error("Failed to sign-in");
if (error instanceof Error) {
return { error: error.message };
} else {

6
package-lock.json generated
View File

@ -1,6 +0,0 @@
{
"name": "Dwinzo_dev",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}