From 675a861cb1abd49dbd0b94c22d1c4264b93a9fdf Mon Sep 17 00:00:00 2001 From: MrOrz Date: Wed, 26 Jan 2022 21:35:14 +0800 Subject: [PATCH] shrink userId, itemId and url into 1 field only --- constants/urls.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/constants/urls.js b/constants/urls.js index d9a0c8c5..554a6210 100644 --- a/constants/urls.js +++ b/constants/urls.js @@ -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}`; };