mirror of
https://github.com/Unleash/unleash.git
synced 2025-05-12 01:17:04 +02:00
feat: set up request execution on form submission
This commit is contained in:
parent
0e4d2cf102
commit
b2a1628ff5
@ -90,7 +90,20 @@ export const FeedbackWrapper = ({ seedData, open }) => {
|
|||||||
dispatch({ kind: 'set customer type', data: customerType });
|
dispatch({ kind: 'set customer type', data: customerType });
|
||||||
|
|
||||||
const submitFeedback = () => {
|
const submitFeedback = () => {
|
||||||
console.log('send feedback here ');
|
fetch(process.env.UNLEASH_FEEDBACK_TARGET_URL, {
|
||||||
|
method: 'post',
|
||||||
|
body: JSON.stringify({ data: state.data }),
|
||||||
|
})
|
||||||
|
.then(async (res) =>
|
||||||
|
res.ok
|
||||||
|
? console.log('Success! Feedback was registered.')
|
||||||
|
: console.warn(
|
||||||
|
`Oh, no! The feedback registration failed: ${await res.text()}`,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.catch((e) =>
|
||||||
|
console.error('Oh, no! The feedback registration failed:', e),
|
||||||
|
);
|
||||||
stepForward();
|
stepForward();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user