Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

enhancement: store query params in docs feedback (#22437)

Charisdd1e0c3591c9
diff --git a/apps/docs/components/Feedback/Feedback.tsx b/apps/docs/components/Feedback/Feedback.tsx
index 96137bfd4a1..364731a611b 100644
--- a/apps/docs/components/Feedback/Feedback.tsx
+++ b/apps/docs/components/Feedback/Feedback.tsx
@@ -85,7 +85,13 @@ function Feedback() {
const showNo = unanswered || isNo
async function sendFeedbackVote(response: Response) {
- const { error } = await supabase.from('feedback').insert({ vote: response, page: pathname })
+ const { error } = await supabase.from('feedback').insert({
+ vote: response,
+ page: pathname,
+ metadata: {
+ query: Object.fromEntries(new URLSearchParams(window.location.search).entries()),
+ },
+ })
if (error) console.error(error)
}
diff --git a/supabase/migrations/20240403133820_track_feedback_query_params.sql b/supabase/migrations/20240403133820_track_feedback_query_params.sql
new file mode 100644
index 00000000000..9557d45f011
--- /dev/null
+++ b/supabase/migrations/20240403133820_track_feedback_query_params.sql
@@ -0,0 +1,2 @@
+alter table public.feedback
+add column metadata jsonb;
\ No newline at end of file