Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
program-service
Commits
bbf2635f
Commit
bbf2635f
authored
3 years ago
by
Amol Ghatol
Browse files
Options
Download
Patches
Plain Diff
Issue #SB-25589 chore: Collection V4 API's integration
parent
0985fcbc
release-5.1.0
dependabot/npm_and_yarn/src/async-2.6.4
dependabot/npm_and_yarn/src/axios-0.21.2
dependabot/npm_and_yarn/src/decode-uri-component-0.2.2
dependabot/npm_and_yarn/src/jsonwebtoken-9.0.0
dependabot/npm_and_yarn/src/lodash-4.17.21
dependabot/npm_and_yarn/src/moment-2.29.4
dependabot/npm_and_yarn/src/moment-timezone-0.5.37
dependabot/npm_and_yarn/src/node-fetch-2.6.7
dependabot/npm_and_yarn/src/qs-and-body-parser-and-express-6.5.3
dependabot/npm_and_yarn/src/redis-3.1.1
dependabot/npm_and_yarn/src/simple-get-2.8.2
dependabot/npm_and_yarn/src/underscore-1.12.1
master
release-4.6.0
release-4.7.0
release-4.8.0
release-4.9.0
release-5.1.0_RC1
release-4.9.0_RC1
release-4.8.0_RC3
release-4.8.0_RC2
release-4.8.0_RC1
release-4.7.0_RC6
release-4.7.0_RC5
release-4.7.0_RC4
release-4.7.0_RC3
release-4.7.0_RC2
release-4.7.0_RC1
release-4.6.0_RC6
release-4.6.0_RC5
release-4.6.0_RC4
release-4.6.0_RC3
release-4.6.0_RC2
release-4.6.0_RC1
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/helpers/programHelper.js
+2
-2
src/helpers/programHelper.js
src/helpers/publishHelper.js
+1
-1
src/helpers/publishHelper.js
src/helpers/updateHierarchy.helper.js
+2
-2
src/helpers/updateHierarchy.helper.js
src/middlewares/request.middleware.js
+2
-1
src/middlewares/request.middleware.js
src/service/print/dataImporter.js
+2
-2
src/service/print/dataImporter.js
with
9 additions
and
8 deletions
+9
-8
src/helpers/programHelper.js
+
2
−
2
View file @
bbf2635f
...
...
@@ -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/co
ntent
/v
3
/hierarchy/
${
collectionId
}
?mode=edit`
,
url
:
`
${
envVariables
.
baseURL
}
/action/co
llection
/v
4
/hierarchy/
${
collectionId
}
?mode=edit`
,
method
:
'
get
'
,
headers
:
{...
req
.
headers
}
};
...
...
This diff is collapsed.
Click to expand it.
src/helpers/publishHelper.js
+
1
−
1
View file @
bbf2635f
...
...
@@ -5,7 +5,7 @@ const axios = require("axios");
const
{
from
}
=
require
(
"
rxjs
"
);
function
getContentMetaData
(
contentId
,
reqHeaders
){
const
url
=
`
${
envVariables
.
CONTENT_SERVICE_URL
}
content/v
3
/read/
${
contentId
}
`
;
const
url
=
`
${
envVariables
.
CONTENT_SERVICE_URL
}
content/v
4
/read/
${
contentId
}
`
;
const
option
=
{
url
:
url
,
method
:
"
get
"
,
...
...
This diff is collapsed.
Click to expand it.
src/helpers/updateHierarchy.helper.js
+
2
−
2
View file @
bbf2635f
...
...
@@ -33,7 +33,7 @@ class HierarchyService {
}
bulkUpdateHierarchy
(
collections
,
reqHeaders
)
{
const
url
=
`
${
envVariables
.
CONTENT_SERVICE_URL
}
co
ntent
/v
3
/hierarchy/update`
;
const
url
=
`
${
envVariables
.
CONTENT_SERVICE_URL
}
co
llection
/v
4
/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/v
3
/create`
;
const
url
=
`
${
envVariables
.
CONTENT_SERVICE_URL
}
content/v
4
/create`
;
const
bulkRequest
=
_
.
map
(
collections
,
collection
=>
{
const
option
=
{
...
...
This diff is collapsed.
Click to expand it.
src/middlewares/request.middleware.js
+
2
−
1
View file @
bbf2635f
...
...
@@ -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
'
]
...
...
This diff is collapsed.
Click to expand it.
src/service/print/dataImporter.js
+
2
−
2
View file @
bbf2635f
...
...
@@ -64,7 +64,7 @@ function getQuestionFromItem(itemID,marks) {
}
const
getQuestionForSection
=
async
(
id
)
=>
{
const
url
=
`
${
envVariables
.
baseURL
}
/action/co
ntent
/v
3
/hierarchy/
${
id
}
?mode=edit`
;
const
url
=
`
${
envVariables
.
baseURL
}
/action/co
llection
/v
4
/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/co
ntent
/v
3
/hierarchy/
${
id
}
?mode=edit`
;
const
url
=
`
${
envVariables
.
baseURL
}
/action/co
llection
/v
4
/hierarchy/
${
id
}
?mode=edit`
;
return
fetch
(
url
)
.
then
((
r4
)
=>
r4
.
json
())
.
then
((
r
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets