This commit is contained in:
adueck 2022-10-11 15:01:28 +05:00
parent 8e92f513fd
commit 3949804dca
1 changed files with 11 additions and 4 deletions

View File

@ -15,10 +15,17 @@ function ChapterFeedback({ chapter }: { chapter: string }) {
setRating(o => o === v ? undefined : v); setRating(o => o === v ? undefined : v);
} }
useEffect(() => { useEffect(() => {
return () => { return () => {
// send face feedback if exists fetch("https://account.lingdocs.com/feedback", {
} method: "PUT",
}) credentials: "include",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ feedback: "", rating }),
})
}
});
function handleSendFeedback() { function handleSendFeedback() {
const toSend = { const toSend = {
chapter, chapter,