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

Store query params so we can figure out what tab the feedback refers to.
This commit is contained in:
Charis
2024-04-03 11:59:55 -04:00
committed by GitHub
parent b3cfc5539d
commit dd1e0c3591
2 changed files with 9 additions and 1 deletions

View File

@@ -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)
}

View File

@@ -0,0 +1,2 @@
alter table public.feedback
add column metadata jsonb;