Basic discussions forum framework

Adds the basic structure for the Discussions MFE around which future development
will happen.
This commit is contained in:
Kshitij Sobti
2020-08-18 16:58:48 +05:30
parent 56d68e76ad
commit 491f7b7acd
58 changed files with 9313 additions and 4194 deletions

View File

@@ -0,0 +1,17 @@
/* eslint-disable import/prefer-default-export */
import { logError } from '@edx/frontend-platform/logging';
import { getThreadComments } from './api';
import { fetchCommentsFailed, fetchCommentsRequest, fetchCommentsSuccess } from './slices';
export function fetchTopicComments(topicId) {
return async (dispatch) => {
try {
dispatch(fetchCommentsRequest({ topicId }));
const data = await getThreadComments(topicId);
dispatch(fetchCommentsSuccess({ topicId, data }));
} catch (error) {
dispatch(fetchCommentsFailed());
logError(error);
}
};
}