Add media to comment data downloads (#3089)

This will update the admin and user CSV
downloads to include a "Media" column that
will specify the media type and the URL
for the media content.

CORL-1188

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Nick Funk
2020-08-10 14:59:30 -06:00
committed by GitHub
parent af842e98ee
commit 5ffb53d0eb
@@ -85,6 +85,7 @@ export async function sendUserDownload(
"Article URL",
"Comment URL",
"Comment Text",
"Media",
]);
/**
@@ -109,7 +110,11 @@ export async function sendUserDownload(
const body = htmlToText.fromString(revision.body);
const commentURL = getURLWithCommentID(story.url, comment.id);
csv.write([comment.id, createdAt, story.url, commentURL, body]);
const media = revision.media
? `${revision.media.type}: ${revision.media.url}`
: "";
csv.write([comment.id, createdAt, story.url, commentURL, body, media]);
}
commentBatch = [];