@@ -521,13 +521,18 @@ useEffect(() => {
521521 }
522522 }
523523
524- const extractUrl = ( url ) => {
524+ const extractUrl = ( url , contentType ) => {
525525 if ( ! url ) return ''
526526
527527 const idx = url . indexOf ( 'courses/' ) ;
528528 if ( idx !== - 1 ) {
529529 // slice from "courses/" onward and strip any leading slashes (defensive)
530- return url . slice ( idx ) . replace ( / ^ \/ + / , '' ) ;
530+ let slicedUrl = url . slice ( idx ) . replace ( / ^ \/ + / , '' ) ;
531+ if ( contentType == "syllabus" ) {
532+ const parts = slicedUrl . split ( "/" )
533+ slicedUrl = `${ parts [ 0 ] } /${ parts [ 1 ] } ?include[]=syllabus_body`
534+ }
535+ return slicedUrl
531536 }
532537
533538 // if no "courses/" found, remove leading slashes and return the remainder
@@ -614,7 +619,7 @@ useEffect(() => {
614619 }
615620
616621 const createContentItemPostOptions = ( fullPageHtml , contentUrl , contentId , contentType , sectionIds ) => {
617- const contentItemOption = {
622+ const contentItemOption = {
618623 fullPageHtml : fullPageHtml ,
619624 contentUrl : contentUrl ,
620625 contentId : contentId ,
@@ -646,7 +651,7 @@ useEffect(() => {
646651 if ( reference . contentItemBody ) {
647652 newFullPageHtml = replaceFileInHtml ( reference . contentItemBody , file . lmsFileId , newFile . metadata . url )
648653 }
649- postContentItemOptions . push ( createContentItemPostOptions ( newFullPageHtml , extractUrl ( reference . contentItemUrl ) , reference . contentItemId , reference . contentType , reference . sectionIds ) )
654+ postContentItemOptions . push ( createContentItemPostOptions ( newFullPageHtml , extractUrl ( reference . contentItemUrl , reference . contentType ) , reference . contentItemId , reference . contentType , reference . sectionIds ) )
650655 } )
651656 }
652657 return postContentItemOptions
@@ -836,6 +841,7 @@ const getSectionPostOptions = (newFile, sectionReferences) => {
836841 const postContentItemOptions = getContentPostItems ( activeFile . replacement , activeFile , contentReferences )
837842 const postSectionOptions = getSectionPostOptions ( activeFile , sectionReferences )
838843
844+
839845 if ( ( postContentItemOptions && postContentItemOptions . length > 0 ) || ( postSectionOptions && postSectionOptions . length > 0 ) ) {
840846 const responseStatus = await updateAndScanContent ( postContentItemOptions , postSectionOptions , activeFile . id )
841847 if ( responseStatus && responseStatus [ 0 ] ?. type == "error" ) {
0 commit comments