feat: [FC-0044] Unit page - Manage access modal (unit & xblocks) (#901)

* feat: [FC-0044] Unit page - Manage access modal (unit & xblocks)

* fix: add message description
This commit is contained in:
Ihor Romaniuk
2024-04-22 17:13:16 +02:00
committed by GitHub
parent 1834655399
commit 6ec44b5f41
37 changed files with 1202 additions and 330 deletions

View File

@@ -88,14 +88,16 @@ export async function createCourseXblock({
* @param {string} unitId - The ID of the course unit.
* @param {string} type - The action type (e.g., PUBLISH_TYPES.discardChanges).
* @param {boolean} isVisible - The visibility status for students.
* @param {boolean} groupAccess - Access group key set.
* @returns {Promise<any>} A promise that resolves with the response data.
*/
export async function handleCourseUnitVisibilityAndData(unitId, type, isVisible) {
export async function handleCourseUnitVisibilityAndData(unitId, type, isVisible, groupAccess) {
const body = {
publish: type,
publish: groupAccess ? null : type,
...(type === PUBLISH_TYPES.republish ? {
metadata: {
visible_to_staff_only: isVisible,
visible_to_staff_only: isVisible ? true : null,
group_access: groupAccess || null,
},
} : {}),
};