mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-03 20:26:03 +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 {
|
||||
exportToCsv: () => {
|
||||
const header = [
|
||||
t("participantCount", {
|
||||
count: participants.length,
|
||||
}),
|
||||
t("name"),
|
||||
t("email"),
|
||||
...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"
|
||||
? day
|
||||
: `${day} ${decodedOption.startTime} - ${decodedOption.endTime}`;
|
||||
|
@ -27,6 +26,7 @@ export const useCsvExporter = () => {
|
|||
const rows = participants.map((participant) => {
|
||||
return [
|
||||
participant.name,
|
||||
participant.email,
|
||||
...poll.options.map((option) => {
|
||||
const vote = participant.votes.find((vote) => {
|
||||
return vote.optionId === option.id;
|
||||
|
|
Loading…
Add table
Reference in a new issue