From 966ff5d40acf24d0860811e1b179197083572bc4 Mon Sep 17 00:00:00 2001 From: muntaxir4 Date: Wed, 19 Feb 2025 14:21:01 +0530 Subject: [PATCH] Fix organization create --- src/components/Dashboard/index.jsx | 3 +-- src/store/actions/authActions.js | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/Dashboard/index.jsx b/src/components/Dashboard/index.jsx index c4147673..322241d7 100644 --- a/src/components/Dashboard/index.jsx +++ b/src/components/Dashboard/index.jsx @@ -226,8 +226,7 @@ const Dashboard = ({ background = "white", textColor = "black" }) => { if (showOrgForm) { validateHandle( checkOrgHandleExists, - firebase, - dispatch, + firestore, orgHandle, setOrgHandleValidateError, setOrgHandleValidateErrorMessage, diff --git a/src/store/actions/authActions.js b/src/store/actions/authActions.js index 04b2f6a0..57440d27 100644 --- a/src/store/actions/authActions.js +++ b/src/store/actions/authActions.js @@ -210,7 +210,6 @@ export const checkOrgHandleExists = orgHandle => async firestore => { .doc(orgHandle) .get(); - console.log(organizationHandle); return organizationHandle.exists; } catch (e) { throw e.message; @@ -244,8 +243,9 @@ export const setUpInitialData = } if (orgData) { - const isOrgHandleExists = - await checkOrgHandleExists(org_handle)(firestore); + const isOrgHandleExists = await checkOrgHandleExists(org_handle)( + firestore + ); if (isOrgHandleExists) { dispatch({ @@ -270,11 +270,14 @@ export const setUpInitialData = ); // Create organisation handle - await firestore.collection("org_users").doc(`${org_handle}_${userData.uid}`).set({ - uid: userData.uid, - org_handle: org_handle, - permissions: [3] - }); + await firestore + .collection("org_users") + .doc(`${org_handle}_${userData.uid}`) + .set({ + uid: userData.uid, + org_handle: org_handle, + permissions: [3] + }); const timeOutID = setTimeout(() => { firebase