Skip to content

Commit

Permalink
fix merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonmyers committed May 22, 2024
1 parent a9ffca2 commit 35dd4c1
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ const { flatten } = require('./util')
const writeToCSV = require('./writeToCSV')
require('dotenv').config();

// Check for COURSE_IDS in environment variables
if (!process.env.COURSE_IDS) {
console.error('Error: COURSE_IDS environment variable is not defined.');
process.exit(1); // Exit the script with a non-zero status
}
require('dotenv').config();

// Check for COURSE_IDS in environment variables
if (!process.env.COURSE_IDS) {
console.error('Error: COURSE_IDS environment variable is not defined.');
Expand Down Expand Up @@ -37,13 +30,6 @@ const getNestedReplies = (replyObj, participants, topicId) => {
postTimestamp: replyObj.created_at,
postParentId: replyObj.parent_id || '',
postId: replyObj.id
postAuthorId: replyObj.user_id,
postAuthorName: authorName,
postMessage: replyObj.message,
postLikes: replyObj.rating_sum || 0,
postTimestamp: replyObj.created_at,
postParentId: replyObj.parent_id || '',
postId: replyObj.id
}, ...replies]
}

Expand All @@ -57,13 +43,11 @@ const getDiscussions = async courseId => {
]))
)
return discussionAndTopic.map(([discussion, topic]) => {
const topicId = topic.id
const topicId = topic.id
const topicTitle = topic.title
const topicMessage = topic.message
const author = topic.author
const topicCreatedAt = topic.created_at
const topicCreatedAt = topic.created_at
const participants = discussion.participants
const replies = discussion.view.length > 0
? discussion.view
Expand All @@ -73,22 +57,17 @@ const getDiscussions = async courseId => {


return {
topicId,
topicId,
topicTitle,
topicMessage,
topicAuthorId: author.id || '',
topicAuthorName: author.display_name || '',
topicCreatedAt,
topicAuthorId: author.id || '',
topicAuthorName: author.display_name || '',
topicCreatedAt,
replies
}
})
}

const courseIds = process.env.COURSE_IDS.split(',').map(id => id.trim());
const courseIds = process.env.COURSE_IDS.split(',').map(id => id.trim());

Promise.all(
Expand Down

0 comments on commit 35dd4c1

Please sign in to comment.