additional changes, setup localStorage

This commit is contained in:
Maciek Głowacki
2020-12-12 17:54:13 +01:00
parent 8ba07f5c07
commit 597f17695d
16 changed files with 12141 additions and 15123 deletions

View File

@ -4,9 +4,9 @@ export const axiosInstance = axios.create();
axiosInstance.interceptors.request.use(
(config) => {
const token = sessionStorage.getItem('userToken');
config.headers['Authorization'] = 'Bearer ' + token;
const token = localStorage.getItem('userToken');
config.headers['Content-Type'] = 'application/json';
config.headers['Authorization'] = token ? `Bearer ${token}` : '';
return config;
},
(error) => {

View File

@ -13,6 +13,10 @@ export const selectGroupsToShow = (schedulerEvents: Array<SchedulerEvent>, index
return schedulerEvents.filter(({ time }: { time: [string, string] }) => courseStartTimeToEventRow[time[0]] === index);
};
//debounce declaration and implementation
type Procedure = (...args: any[]) => any;
interface Debounce {