Allow admins select a cohort when creating a new post. If a user is not a discussions administrator, or if trying to edit existing post, can't select a cohort (field is hidden). fix: fix adding threads for topics that haven't been preloaded
23 lines
614 B
JavaScript
23 lines
614 B
JavaScript
import { configureStore } from '@reduxjs/toolkit';
|
|
|
|
import { cohortsReducer } from './discussions/cohorts/data';
|
|
import { commentsReducer } from './discussions/comments/data';
|
|
import { threadsReducer } from './discussions/posts/data';
|
|
import { topicsReducer } from './discussions/topics/data';
|
|
|
|
export function initializeStore(preloadedState = undefined) {
|
|
return configureStore({
|
|
reducer: {
|
|
topics: topicsReducer,
|
|
threads: threadsReducer,
|
|
comments: commentsReducer,
|
|
cohorts: cohortsReducer,
|
|
},
|
|
preloadedState,
|
|
});
|
|
}
|
|
|
|
const store = initializeStore();
|
|
|
|
export default store;
|