Skip to content

Commit 24a4513

Browse files
committed
Update feedback vote retrieval in DocsHelp component to use a local variable for improved readability and maintainability.
1 parent 616907b commit 24a4513

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/DocsHelp.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ export function DocsHelp({
9797
setIsSubmitting(true);
9898

9999
try {
100+
const selectedInput = feedbackFormRef.current?.querySelector(
101+
'input[name="feedback-vote"]:checked',
102+
) as HTMLInputElement | null;
103+
100104
const response = await fetch(
101105
'https://script.google.com/macros/s/AKfycbx9KA_BwTdsYgOfTLrHAxuhHs_wgYibB5_Msj9XP1rL5Ip4A20g1O609xAuTZmnbhRv/exec',
102106
{
@@ -105,7 +109,7 @@ export function DocsHelp({
105109
headers: { 'Content-Type': 'text/plain;charset=utf-8' },
106110
body: JSON.stringify({
107111
feedbackPage: router.asPath,
108-
feedbackVote: (feedbackFormRef.current?.querySelector('input[name="feedback-vote"]:checked') as HTMLInputElement)?.value,
112+
feedbackVote: selectedInput?.value,
109113
feedbackComment: commentValue,
110114
}),
111115
},

0 commit comments

Comments
 (0)