Skip to content

Commit

Permalink
approved and unapproved question
Browse files Browse the repository at this point in the history
  • Loading branch information
Rekha committed Jul 14, 2023
1 parent 4774ce6 commit 9220d28
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/service/print/printDocxV1.0/dataImporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ const getQuestionForSet = async (id) => {
}
})
};
const getQuestionSet = async (id) => {
const headers = {
const getQuestionSet = async (config) => {
const id = config.id;
const headers = {
Authorization: "Bearer " + envVariables.SUNBIRD_PORTAL_API_AUTH_TOKEN
};
let url= `${QS_HIERARCHY_READ_URL}${id}?mode=edit`
Expand All @@ -56,9 +57,15 @@ const getQuestionSet = async (id) => {
if (section.children)
return section.children
.filter(
(child) =>
data.acceptedContributions &&
data.acceptedContributions.indexOf(child.identifier) > -1
(child) =>{
if(config && config.allQuestions && child.status.toLowerCase()==='live'){
return child;
}
else if (data.acceptedContributions &&
data.acceptedContributions.indexOf(child.identifier) > -1){
return child;
}
}
)
.map((child) => {
return child.identifier;
Expand Down

0 comments on commit 9220d28

Please sign in to comment.