fix: block url conditional (#393)
This commit is contained in:
@@ -29,9 +29,9 @@ export const returnUrl = ({
|
||||
};
|
||||
|
||||
export const block = ({ studioEndpointUrl, blockId }) => (
|
||||
blockId.includes('block-v1')
|
||||
? `${studioEndpointUrl}/xblock/${blockId}`
|
||||
: `${studioEndpointUrl}/api/xblock/v2/xblocks/${blockId}/fields/`
|
||||
blockId.startsWith('lb:')
|
||||
? `${studioEndpointUrl}/api/xblock/v2/xblocks/${blockId}/fields/`
|
||||
: `${studioEndpointUrl}/xblock/${blockId}`
|
||||
);
|
||||
|
||||
export const blockAncestor = ({ studioEndpointUrl, blockId }) => {
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
describe('cms url methods', () => {
|
||||
const studioEndpointUrl = 'urLgoeStOstudiO';
|
||||
const blockId = 'block-v1-blOckIDTeST123';
|
||||
const v2BlockId = 'blOckIDTeST123';
|
||||
const v2BlockId = 'lb:blOckIDTeST123';
|
||||
const learningContextId = 'lEarnIngCOntextId123';
|
||||
const libraryLearningContextId = 'library-v1:libaryId123';
|
||||
const courseId = 'course-v1:courseId123';
|
||||
|
||||
Reference in New Issue
Block a user