feat: added captcha to discussion post creation (#785)
* feat: added captcha to discussion post creation * feat: added captcha for comment and response * fix: removed learner check * test: fixed test cases * fix: removed comment and added check for empty sitekey * fix: fixed translation issue * test: added test cases for recaptcha * test: should allow posting a comment with CAPTCHA * test: added submit post test cases * test: test edge cases for api * test: added test cases for react-google-recaptcha * test: added test case for default values for captcha * fix: removed unused catch --------- Co-authored-by: sundasnoreen12 <sundasnoreen12@gmail.com> Co-authored-by: Awais Ansari <awais.ansari63@gmail.com>
This commit is contained in:
@@ -205,6 +205,7 @@ export function createNewThread({
|
||||
cohort,
|
||||
enableInContextSidebar,
|
||||
notifyAllLearners,
|
||||
recaptchaToken,
|
||||
}) {
|
||||
return async (dispatch) => {
|
||||
try {
|
||||
@@ -219,6 +220,7 @@ export function createNewThread({
|
||||
anonymousToPeers,
|
||||
cohort,
|
||||
notifyAllLearners,
|
||||
recaptchaToken,
|
||||
}));
|
||||
const data = await postThread(courseId, topicId, type, title, content, {
|
||||
cohort,
|
||||
@@ -226,6 +228,7 @@ export function createNewThread({
|
||||
anonymous,
|
||||
anonymousToPeers,
|
||||
notifyAllLearners,
|
||||
recaptchaToken,
|
||||
}, enableInContextSidebar);
|
||||
dispatch(postThreadSuccess(camelCaseObject(data)));
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user