feat: add support for anonymous posting

Hooks up the configuration API to allow posting threads anonymously.
This commit is contained in:
Kshitij Sobti
2021-11-09 18:49:23 +05:30
parent 6bd7ce929d
commit 18d19369a9
15 changed files with 211 additions and 34 deletions

View File

@@ -170,7 +170,9 @@ export function createNewThread({
type,
title,
content,
following = false,
following,
anonymous,
anonymousToPeers,
cohort,
}) {
return async (dispatch) => {
@@ -182,9 +184,16 @@ export function createNewThread({
title,
content,
following,
anonymous,
anonymousToPeers,
cohort,
}));
const data = await postThread(courseId, topicId, type, title, content, following, cohort);
const data = await postThread(courseId, topicId, type, title, content, {
cohort,
following,
anonymous,
anonymousToPeers,
});
dispatch(postThreadSuccess(camelCaseObject(data)));
} catch (error) {
if (getHttpErrorStatus(error) === 403) {