- added login page;
- added file upload; - added faq item edit modal;
This commit is contained in:
@@ -12,4 +12,12 @@ export const actionsAlpha = (set, get, api) => ({
|
||||
})
|
||||
|
||||
export const actionsBeta = (set, get, api) => ({
|
||||
setAuthData: ({ userData, token }) => {
|
||||
set.userData(userData);
|
||||
set.token(token);
|
||||
},
|
||||
doLogout: () => {
|
||||
set.userData({});
|
||||
set.token('');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
const initialStore = {
|
||||
// ui related
|
||||
isAsyncRequest: 0, // number
|
||||
// user
|
||||
userData: {},
|
||||
token: '',
|
||||
// bando form
|
||||
bandoFormErrors: {},
|
||||
// form builder
|
||||
elements: [],
|
||||
elementItems: [],
|
||||
activeElement: ''
|
||||
}
|
||||
|
||||
export default initialStore;
|
||||
@@ -1,9 +1,6 @@
|
||||
import { isEmpty } from 'ramda';
|
||||
|
||||
const selectors = (state, get, api) => ({
|
||||
getToken: () => {
|
||||
const userData = get.userData();
|
||||
return userData.access && !isEmpty(userData.access) ? userData.access : null;
|
||||
return get.token();
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@ const zustandXOpts = {
|
||||
enabled: true,
|
||||
partialize: (state) => ({
|
||||
userData: state.userData,
|
||||
hubsList: state.hubsList,
|
||||
chosenHub: state.chosenHub,
|
||||
groups: state.groups,
|
||||
token: state.token
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user