mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-04 12:46:04 +02:00
✨ Include email address and year in csv exporter
This commit is contained in:
parent
b10c64b7da
commit
692068bc5d
1 changed files with 4 additions and 4 deletions
|
@ -14,11 +14,10 @@ export const useCsvExporter = () => {
|
||||||
return {
|
return {
|
||||||
exportToCsv: () => {
|
exportToCsv: () => {
|
||||||
const header = [
|
const header = [
|
||||||
t("participantCount", {
|
t("name"),
|
||||||
count: participants.length,
|
t("email"),
|
||||||
}),
|
|
||||||
...options.map((decodedOption) => {
|
...options.map((decodedOption) => {
|
||||||
const day = `${decodedOption.dow} ${decodedOption.day} ${decodedOption.month}`;
|
const day = `${decodedOption.dow} ${decodedOption.day} ${decodedOption.month} ${decodedOption.year}`;
|
||||||
return decodedOption.type === "date"
|
return decodedOption.type === "date"
|
||||||
? day
|
? day
|
||||||
: `${day} ${decodedOption.startTime} - ${decodedOption.endTime}`;
|
: `${day} ${decodedOption.startTime} - ${decodedOption.endTime}`;
|
||||||
|
@ -27,6 +26,7 @@ export const useCsvExporter = () => {
|
||||||
const rows = participants.map((participant) => {
|
const rows = participants.map((participant) => {
|
||||||
return [
|
return [
|
||||||
participant.name,
|
participant.name,
|
||||||
|
participant.email,
|
||||||
...poll.options.map((option) => {
|
...poll.options.map((option) => {
|
||||||
const vote = participant.votes.find((vote) => {
|
const vote = participant.votes.find((vote) => {
|
||||||
return vote.optionId === option.id;
|
return vote.optionId === option.id;
|
||||||
|
|
Loading…
Add table
Reference in a new issue