cds-snc / platform-forms-client

NextJS application that serves the public-facing website for Forms
https://forms-staging.cdssandbox.xyz/
MIT License
35 stars 13 forks source link

Reduce code duplication related to CSV #4667

Open thiessenp-cds opened 3 days ago

thiessenp-cds commented 3 days ago

Some tech debt:

Merge the related code for formatting CSV currently in (and possibly other places):

Also the code to download a file could be exported to a util function:

    const url = URL.createObjectURL(blob);
    const a = document.createElement("a");
    a.href = url;
    a.download = slugify(fileName) + "." + extension};
    a.click();
    URL.revokeObjectURL(url);