Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions src/lib/stores/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ function createFeedbackStore() {
return feedback;
});
},
// TODO: update growth server to accept `billingPlan`.
// TODO: update growth server to accept `source` key to know the feedback source area.
submitFeedback: async (
subject: string,
message: string,
Expand All @@ -122,18 +120,6 @@ function createFeedbackStore() {
if (!VARS.GROWTH_ENDPOINT) return;
trackEvent(Submit.FeedbackSubmit);

const customFields: Array<{ id: string; value: string | number }> = [
{ id: '47364', value: currentPage }
];

if (value) {
customFields.push({ id: '40655', value });
}

if (billingPlan) {
customFields.push({ id: '56109', value: billingPlan });
}

const response = await fetch(`${VARS.GROWTH_ENDPOINT}/feedback`, {
method: 'POST',
headers: {
Expand All @@ -143,9 +129,11 @@ function createFeedbackStore() {
subject,
message,
email,
customFields,
firstname: (name || 'Unknown').slice(0, 40),
metaFields: {
currentPage,
npsScore: value,
billingPlan,
source: get(feedback).source,
orgId,
projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,11 @@
firstName: ($user?.name ?? '').slice(0, 40),
message: `BAA request for ${$organization?.name ?? ''} (${$organization?.$id ?? ''})`,
tags: ['cloud'],
customFields: [
{ id: '41612', value: 'BAA' },
{ id: '48493', value: $user?.name ?? '' },
{ id: '48492', value: $organization?.$id ?? '' },
{ id: '48490', value: $user?.$id ?? '' }
],
metaFields: {
category: 'BAA',
userName: $user?.name ?? '',
orgId: $organization?.$id ?? '',
userId: $user?.$id ?? '',
employees: employees,
country: country,
role: role,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@
firstName: ($user?.name ?? '').slice(0, 40),
message: `SOC-2 request for ${$organization?.name ?? ''} (${$organization?.$id ?? ''})`,
tags: ['cloud'],
customFields: [
{ id: '41612', value: 'SOC-2' },
{ id: '48493', value: $user?.name ?? '' },
{ id: '48492', value: $organization?.$id ?? '' },
{ id: '48490', value: $user?.$id ?? '' }
],
metaFields: {
category: 'SOC-2',
userName: $user?.name ?? '',
orgId: $organization?.$id ?? '',
userId: $user?.$id ?? '',
employees: employees,
country: country,
role: role,
Expand Down
16 changes: 8 additions & 8 deletions src/routes/(console)/supportWizard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@
formData.append('message', $supportData.message);
formData.append('tags[]', categoryTopicTag);
formData.append(
'customFields',
JSON.stringify([
{ id: '41612', value: $supportData.category },
{ id: '48492', value: $organization?.$id ?? '' },
{ id: '48491', value: $supportData?.project ?? '' },
{ id: '56023', value: $supportData?.severity ?? '' },
{ id: '56024', value: $organization?.billingPlanId ?? '' }
])
'metaFields',
JSON.stringify({
category: $supportData.category,
orgId: $organization?.$id ?? '',
projectId: $supportData?.project ?? '',
severity: $supportData?.severity ?? '',
billingPlan: $organization?.billingPlanId ?? ''
})
);
if (files && files.length > 0) {
formData.append('attachment', files[0]);
Expand Down