Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/components/Dashboard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ const Dashboard = ({ background = "white", textColor = "black" }) => {
if (showOrgForm) {
validateHandle(
checkOrgHandleExists,
firebase,
dispatch,
firestore,
orgHandle,
setOrgHandleValidateError,
setOrgHandleValidateErrorMessage,
Expand Down
19 changes: 11 additions & 8 deletions src/store/actions/authActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ export const checkOrgHandleExists = orgHandle => async firestore => {
.doc(orgHandle)
.get();

console.log(organizationHandle);
return organizationHandle.exists;
} catch (e) {
throw e.message;
Expand Down Expand Up @@ -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({
Expand All @@ -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
Expand Down
Loading