File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
src/controllers/satisfactionSurvey Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ const surveyQueryObject = {
52
52
] ,
53
53
} ;
54
54
const formatSurveyObject = async ( surveyObject ) => {
55
+ //console.log(`*****\n\n\n\n\n${surveyObject.satisfactionSurveyRecipients}\n\n\n\n\n*****`);
55
56
const recipients = await fetchRecipientData (
56
57
surveyObject . satisfactionSurveyRecipients
57
58
) ;
@@ -248,16 +249,16 @@ exports.createRecord = async (req, res) => {
248
249
249
250
if ( satisfactionSurveyQuestions ) {
250
251
// Save questions
251
- let orderNumber = 1 ;
252
+ // let orderNumber = 1;
252
253
const questions = [ ] ;
253
254
for ( let question of satisfactionSurveyQuestions ) {
254
255
const questionData = {
255
256
surveyId,
256
- orderNumber,
257
- question,
257
+ orderNumber : question . orderNumber ,
258
+ question : question . question ,
258
259
} ;
259
260
questions . push ( questionData ) ;
260
- orderNumber ++ ;
261
+ // orderNumber++;
261
262
}
262
263
if ( questions . length > 0 ) {
263
264
await db . satisfactionSurveyQuestion . bulkCreate ( questions , {
@@ -269,8 +270,11 @@ exports.createRecord = async (req, res) => {
269
270
if ( satisfactionSurveyRecipients ) {
270
271
// Save recipient data
271
272
const recipients = [ ] ;
272
- for ( let empId of satisfactionSurveyRecipients ) {
273
- recipients . push ( { surveyId, empId } ) ;
273
+ for ( let emp of satisfactionSurveyRecipients ) {
274
+ recipients . push ( {
275
+ surveyId,
276
+ empId : emp . empId
277
+ } ) ;
274
278
}
275
279
await db . satisfactionSurveyRecipient . bulkCreate ( recipients , {
276
280
validate : true ,
You can’t perform that action at this time.
0 commit comments