From 2e92b2e59b543c4c20f52295ef3913f229ed20d3 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Mon, 25 Nov 2024 23:30:16 -0500 Subject: Redeem submit --- src/UI.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/UI.js') diff --git a/src/UI.js b/src/UI.js index b27b10b..5f1aaa0 100644 --- a/src/UI.js +++ b/src/UI.js @@ -1,9 +1,25 @@ export const _cheatLog = (a) => () => console.log(a); export const _setInterval = (delay) => (f) => () => setInterval(f, delay); export const _toJSON = (x) => JSON.stringify(x); + export const _reload = () => { window.location.reload(); }; + export const _redirect = (url) => () => { window.location.href = url; }; + +export const _submitRedeem = (url) => (el) => () => { + const redeem = el.children[0].textContent; + const inp = el.children[1]?.value; + console.log(redeem, inp); + const data = new FormData(); + data.append("ayem", "test"); + data.append("name", redeem); + data.append("input", inp); + fetch(url, { + method: "post", + body: data, + }); +}; -- cgit v1.2.3