Restricted access to OrgBashboard
This commit is contained in:
parent
cb0c91e1ac
commit
def9f4bb0e
1 changed files with 5 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useState, useEffect } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import Cookies from 'js-cookie';
|
||||
import {
|
||||
|
|
@ -26,6 +26,7 @@ function OrgDashboard() {
|
|||
});
|
||||
const [rows, setRows] = useState([]);
|
||||
const { orgID } = useParams();
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
async function getData() {
|
||||
|
|
@ -62,6 +63,9 @@ function OrgDashboard() {
|
|||
};
|
||||
});
|
||||
setRows(() => orgMembers);
|
||||
})
|
||||
.catch((error) => {
|
||||
navigate('/');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue