From 18ec372e902dbaf462b9b86891bc99bbfac7284e Mon Sep 17 00:00:00 2001 From: Henrik Nygren Date: Fri, 13 Dec 2024 17:13:56 +0200 Subject: [PATCH] Don't update marketing consent if it's not asked --- .../src/components/forms/SelectCourseInstanceForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/course-material/src/components/forms/SelectCourseInstanceForm.tsx b/services/course-material/src/components/forms/SelectCourseInstanceForm.tsx index ab2bf218f76..631aa1d2d81 100644 --- a/services/course-material/src/components/forms/SelectCourseInstanceForm.tsx +++ b/services/course-material/src/components/forms/SelectCourseInstanceForm.tsx @@ -123,7 +123,7 @@ const SelectCourseInstanceForm: React.FC< backgroundQuestionAnswers: additionalQuestionAnswers, }) } - if (getCourse.isSuccess) { + if (getCourse.isSuccess && getCourse.data?.ask_marketing_consent) { await updateMarketingConsent( getCourse.data.id, getCourse.data.course_language_group_id,