Commit bbf2635f authored by Amol Ghatol's avatar Amol Ghatol
Browse files

Issue #SB-25589 chore: Collection V4 API's integration

Showing with 9 additions and 8 deletions
+9 -8
......@@ -300,7 +300,7 @@ class ProgramServiceHelper {
result['Status'] = 'Corrections pending';
}
return result;
});
});
}
return tableData;
} catch (err) {
......@@ -448,7 +448,7 @@ class ProgramServiceHelper {
hierarchyRequest(req, collectionId) {
const option = {
url: `${envVariables.baseURL}/action/content/v3/hierarchy/${collectionId}?mode=edit`,
url: `${envVariables.baseURL}/action/collection/v4/hierarchy/${collectionId}?mode=edit`,
method: 'get',
headers: {...req.headers}
};
......
......@@ -5,7 +5,7 @@ const axios = require("axios");
const { from } = require("rxjs");
function getContentMetaData(contentId, reqHeaders){
const url = `${envVariables.CONTENT_SERVICE_URL}content/v3/read/${contentId}`;
const url = `${envVariables.CONTENT_SERVICE_URL}content/v4/read/${contentId}`;
const option = {
url: url,
method: "get",
......
......@@ -33,7 +33,7 @@ class HierarchyService {
}
bulkUpdateHierarchy(collections, reqHeaders) {
const url = `${envVariables.CONTENT_SERVICE_URL}content/v3/hierarchy/update`;
const url = `${envVariables.CONTENT_SERVICE_URL}collection/v4/hierarchy/update`;
const bulkRequest = _.map(collections, collection => {
const createdBy = this.getCreatedBy(collection);
const option = {
......@@ -71,7 +71,7 @@ class HierarchyService {
}
createCollection(collections, reqHeaders) {
const url = `${envVariables.CONTENT_SERVICE_URL}content/v3/create`;
const url = `${envVariables.CONTENT_SERVICE_URL}content/v4/create`;
const bulkRequest = _.map(collections, collection => {
const option = {
......
......@@ -137,7 +137,8 @@ function validateToken (req, res, next) {
var payload = jwt.decode(tokenData.token)
delete req.headers['x-authenticated-userid']
var url = req.path
if (!url.includes('/content/v3/review') &&
if (!url.includes('/content/v4/review') &&
!url.includes('/content/v3/review') &&
!url.includes('/v1/content/review') &&
!url.includes('/v1/course/review')) {
delete req.headers['x-authenticated-user-token']
......
......@@ -64,7 +64,7 @@ function getQuestionFromItem(itemID,marks) {
}
const getQuestionForSection = async (id) => {
const url = `${envVariables.baseURL}/action/content/v3/hierarchy/${id}?mode=edit`;
const url = `${envVariables.baseURL}/action/collection/v4/hierarchy/${id}?mode=edit`;
let status;
return fetch(url)
.then((r1) => {
......@@ -103,7 +103,7 @@ const getQuestionForSection = async (id) => {
const getData = async (id) => {
let error = false;
let errorMsg = "";
const url = `${envVariables.baseURL}/action/content/v3/hierarchy/${id}?mode=edit`;
const url = `${envVariables.baseURL}/action/collection/v4/hierarchy/${id}?mode=edit`;
return fetch(url)
.then((r4) => r4.json())
.then((r) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment