Skip to content

Commit

Permalink
Merge pull request #473 from cofacts/shrink-report-fields
Browse files Browse the repository at this point in the history
Shrink userId, itemId and url into 1 field only when reporting user
  • Loading branch information
MrOrz authored Jan 26, 2022
2 parents ebf9f1d + 675a861 commit 8731fdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion constants/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const DONATION_URL =
* @returns {string} Pre-filled URL to the google form that reports spam.
*/
export const getSpamReportUrl = ({ userId, itemType, itemId }) => {
const payload = { userId, itemId, url: location.href };

// Prefilled URL as constant, manually edited to become template string
return `https://docs.google.com/forms/d/e/1FAIpQLSf7d8xCAz682vR3WLRVTxqqbWiFXLd6ShZpOnsXXTmAbPFcUA/viewform?usp=pp_url&entry.1302713624=${userId}&entry.192715150=${itemId}&entry.511781180=${itemType}&entry.1691230719=${location.href}`;
return `https://docs.google.com/forms/d/e/1FAIpQLSf7d8xCAz682vR3WLRVTxqqbWiFXLd6ShZpOnsXXTmAbPFcUA/viewform?usp=pp_url&entry.1302713624=${encodeURIComponent(
JSON.stringify(payload)
)}&entry.511781180=${itemType}`;
};

0 comments on commit 8731fdf

Please sign in to comment.