This commit is contained in:
Maciek Głowacki
2020-12-29 01:06:39 +01:00
parent 56b7b8ef88
commit bbba8618cb
8 changed files with 69 additions and 36 deletions

View File

@ -20,8 +20,6 @@ export const StudentsProvider = ({ children }: StudentsProviderProps) => {
const [selectedStudent, setSelectedStudent] = useState<Student | null>(null);
//not working currently
const userPrivilige = localStorage.getItem('userPrivilige');
const { user } = useContext(CASContext)!;
const getStudents = async () => {
try {
@ -41,8 +39,9 @@ export const StudentsProvider = ({ children }: StudentsProviderProps) => {
useEffect(() => {
setTimeout(() => {
// user?.authorityRole === 'DEANERY' &&
getStudents();
const userPrivilige = localStorage.getItem('userPrivilige');
console.log('mordo privilidż: ', userPrivilige);
userPrivilige === 'DEANERY' && getStudents();
}, 500);
}, []);