Make currentPage a required param for sendFeedback

This commit is contained in:
ernstmul
2024-11-07 11:16:24 +01:00
parent 5a6c44994c
commit 0c59ce226b
4 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -18,10 +18,10 @@
await feedback.submitFeedback(
`feedback-${$feedback.type}`,
$feedbackData.message,
$page.url.href,
$user.name,
$user.email,
$organization.billingPlan,
$page.url.href,
$feedbackData.value
);
addNotification({
+2 -2
View File
@@ -112,12 +112,12 @@ function createFeedbackStore() {
submitFeedback: async (
subject: string,
message: string,
currentPage: string,
name?: string,
email?: string,
// eslint-disable-next-line
// @ts-expect-error
billingPlan?: string,
currentPage?: string,
value?: number
) => {
if (!VARS.GROWTH_ENDPOINT) return;
@@ -133,7 +133,7 @@ function createFeedbackStore() {
// billingPlan,
firstname: name || 'Unknown',
customFields: [
{ id: '47364', value: currentPage ?? '' },
{ id: '47364', value: currentPage },
...(value ? [{ id: '40655', value }] : [])
],
metaFields: {
@@ -1,4 +1,5 @@
<script lang="ts">
import { page } from '$app/stores';
import { Alert, Box, Modal } from '$lib/components';
import { Button, InputText, InputTextarea } from '$lib/elements/forms';
import { getFormData } from '$lib/helpers/form';
@@ -52,7 +53,7 @@
const { endpoint, feedback: message } = formData;
try {
await feedback.submitFeedback(`feedback-${$feedback.type}`, message);
await feedback.submitFeedback(`feedback-${$feedback.type}`, message, $page.url.href);
} catch (error) {
console.error(
'Feedback could not be submitted, but we continue to redirect to do export.'
@@ -18,10 +18,10 @@
await feedback.submitFeedback(
`feedback-${$feedback.type}`,
$feedbackData.message,
$page.url.href,
$user.name,
$user.email,
$organization.billingPlan,
$page.url.href,
$feedbackData.value
);
addNotification({