Skip to content

Commit

Permalink
adding description to csv export (#251)
Browse files Browse the repository at this point in the history
just added the short and long description to the csv exporter.
  • Loading branch information
theClarkSell committed Jun 12, 2024
2 parents 4af75fc + 1f9d7c2 commit c0450bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/_dataSources/api.that.tech/me/favorites/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const favoriteFragment = `
eventId
title
shortDescription
longDescription
durationInMinutes
status
startTime
Expand Down
10 changes: 9 additions & 1 deletion src/routes/(admin my)/my/favorites/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@
})
}))();
const isDate = (checkDate) => dayjs(checkDate).isValid;
function excapeText(text) {
let escapedText = text.replace(/"/g, '""'); // Escape double quotes
return escapedText;
}
const isDate = (checkDate) => dayjs(checkDate).isValid;
const csvDownloadHandler = () => {
const csvdata = activities.map((a) => ({
id: a.id,
Expand All @@ -38,6 +42,8 @@
slot: isDate(a.startTime) ? dayjs(a.startTime).format('HH:mm') : '',
room: a.location?.destination ? a.location?.destination : '',
title: a.title ? a.title : '',
shortDescription: a.shortDescription ? excapeText(a.shortDescription) : '',
longDescription: a.longDescription ? excapeText(a.longDescription) : '',
speakers: a.speakers.map((s) => `${s.firstName} ${s.lastName}`).join(';'),
priCategory: a.priCategory ? a.priCategory : '',
sessionLink: `https://thatconference.com/activities/${a.id}/`,
Expand All @@ -51,6 +57,8 @@
'Slot',
'Room',
'Title',
'Short Description',
'Long Description',
'Speakers',
'Category',
'Link',
Expand Down

0 comments on commit c0450bc

Please sign in to comment.