mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01: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 });
|
||||
|
||||
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();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user