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
e4b0387f
Commit
e4b0387f
authored
3 years ago
by
Vaibhav
Browse files
Options
Download
Patches
Plain Diff
Issue #SB-23374 feat : question bulk upload status API issue fixes
parent
3ddfbb1d
SB-23374
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.5.0
release-4.6.0
release-4.7.0
release-4.8.0
release-4.9.0
release-5.1.0
test-issue
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
release-4.5.0_RC1
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/service/kafkaQumlConsumerService.js
+17
-15
src/service/kafkaQumlConsumerService.js
with
17 additions
and
15 deletions
+17
-15
src/service/kafkaQumlConsumerService.js
+
17
−
15
View file @
e4b0387f
...
...
@@ -18,14 +18,16 @@ const templateClassMap = {
"
3
"
:
'
mcq-horizontal
'
}
const
total_options
=
4
;
const
ASSET_CREATE_URL
=
"
/asset/v1/create
"
;
const
ASSET_UPLOAD_URL
=
"
/asset/v1/upload/
"
;
const
QUESTION_CREATE_URL
=
"
/question/v4/create
"
const
QUESTION_REVIEW_URL
=
"
/question/v4/review/
"
;
const
QUESTION_PUBLISH_URL
=
"
/question/v4/publish/
"
;
const
QUESTION_UPDATE_URL
=
"
/question/v4/update/
"
;
const
QUESTIONSET_ADD_URL
=
"
/questionset/v4/add
"
;
const
API_URL
=
{
ASSET_CREATE
:
"
/asset/v1/create
"
,
ASSET_UPLOAD
:
"
/asset/v1/upload/
"
,
QUESTION_CREATE
:
"
/question/v4/create
"
,
QUESTION_REVIEW
:
"
/question/v4/review/
"
,
QUESTION_PUBLISH
:
"
/question/v4/publish/
"
,
QUESTION_UPDATE
:
"
/question/v4/update/
"
,
QUESTIONSET_ADD
:
"
/questionset/v4/add
"
,
}
const
rspObj
=
{};
const
qumlConsumer
=
()
=>
{
...
...
@@ -155,7 +157,7 @@ const createAssest = (question, data, callback) => {
}
};
console
.
log
(
"
createAssest request Body =====>
"
,
reqBody
);
fetch
(
`
${
envVariables
.
baseURL
}${
ASSET_CREATE
_URL
}
`
,
{
fetch
(
`
${
envVariables
.
baseURL
}${
API_URL
.
ASSET_CREATE
}
`
,
{
method
:
"
POST
"
,
// or 'PUT'
headers
:
{
"
X-Channel-ID
"
:
question
.
channel
,
...
...
@@ -188,7 +190,7 @@ const uploadAsset = (data, callback) => {
console
.
log
(
"
uploadAsset : ==>
"
,
data
);
var
formdata
=
new
FormData
();
formdata
.
append
(
"
file
"
,
fs
.
createReadStream
(
data
.
filePath
),
data
.
name
);
fetch
(
`
${
envVariables
.
baseURL
}${
ASSET_UPLOAD
_URL
}${
data
.
identifier
}
`
,
{
fetch
(
`
${
envVariables
.
baseURL
}${
API_URL
.
ASSET_UPLOAD
}${
data
.
identifier
}
`
,
{
method
:
"
POST
"
,
// or 'PUT'
headers
:
{
"
Authorization
"
:
`Bearer
${
envVariables
.
SUNBIRD_PORTAL_API_AUTH_TOKEN
}
`
...
...
@@ -342,7 +344,7 @@ const createQuestion = (questionBody, callback) => {
};
//fetch call for creating a question.
console
.
log
(
'
createQuestionBody::
'
,
JSON
.
stringify
(
createApiData
));
fetch
(
`
${
envVariables
.
SUNBIRD_ASSESSMENT_SERVICE_BASE_URL
}${
QUESTION_CREATE
_URL
}
`
,
{
fetch
(
`
${
envVariables
.
SUNBIRD_ASSESSMENT_SERVICE_BASE_URL
}${
API_URL
.
QUESTION_CREATE
}
`
,
{
method
:
"
POST
"
,
// or 'PUT'
headers
:
{
"
Content-Type
"
:
"
application/json
"
,
...
...
@@ -374,7 +376,7 @@ const reviewQuestion = (status, questionRes, callback) => {
}
let
reviewData
=
{
request
:
{
question
:
{}
}
};
fetch
(
`
${
envVariables
.
SUNBIRD_ASSESSMENT_SERVICE_BASE_URL
}${
QUESTION_REVIEW
_URL
}${
questionRes
.
result
.
identifier
}
`
,
fetch
(
`
${
envVariables
.
SUNBIRD_ASSESSMENT_SERVICE_BASE_URL
}${
API_URL
.
QUESTION_REVIEW
}${
questionRes
.
result
.
identifier
}
`
,
{
method
:
"
POST
"
,
// or 'PUT'
headers
:
{
...
...
@@ -411,7 +413,7 @@ const publishQuestion = (status, questionRes, callback) => {
}
let
publishApiData
=
{
request
:
{
question
:
{}
}
};
fetch
(
`
${
envVariables
.
SUNBIRD_ASSESSMENT_SERVICE_BASE_URL
}${
QUESTION_PUBLISH
_URL
}${
questionRes
.
result
.
identifier
}
`
,
`
${
envVariables
.
SUNBIRD_ASSESSMENT_SERVICE_BASE_URL
}${
API_URL
.
QUESTION_PUBLISH
}${
questionRes
.
result
.
identifier
}
`
,
{
method
:
"
POST
"
,
// or 'PUT'
headers
:
{
...
...
@@ -453,7 +455,7 @@ const linkQuestionToQuestionSet = (questionData, questionRes, callback) => {
"
children
"
:
[
questionRes
.
result
.
identifier
]
}
}
};
fetch
(
`
${
envVariables
.
SUNBIRD_ASSESSMENT_SERVICE_BASE_URL
}${
QUESTIONSET_ADD
_URL
}
`
,
`
${
envVariables
.
SUNBIRD_ASSESSMENT_SERVICE_BASE_URL
}${
API_URL
.
QUESTIONSET_ADD
}
`
,
{
method
:
"
PATCH
"
,
// or 'PUT'
headers
:
{
...
...
@@ -504,7 +506,7 @@ const updateResponse = (updateData, updateMessage) => {
}
};
console
.
log
(
"
updateResponse :: request Body::
"
,
updateNewData
);
fetch
(
`
${
envVariables
.
SUNBIRD_ASSESSMENT_SERVICE_BASE_URL
}${
QUESTION_UPDATE
_URL
}${
updateData
}
`
,
{
fetch
(
`
${
envVariables
.
SUNBIRD_ASSESSMENT_SERVICE_BASE_URL
}${
API_URL
.
QUESTION_UPDATE
}${
updateData
}
`
,
{
method
:
"
PATCH
"
,
// or 'PUT'
headers
:
{
"
Content-Type
"
:
"
application/json
"
,
...
...
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