add ref link error, add refill button, update referral invites table

This commit is contained in:
smanylov
2026-02-09 16:07:49 +07:00
parent da99d7e2a8
commit b6c5c59919
6 changed files with 102 additions and 35 deletions
+55 -1
View File
@@ -97,7 +97,7 @@ export async function fetchReferralInvitees() {
message_body: {
action: 'invitees',
token: token,
pageSize: 10,
pageSize: 100,
pageNumber: 0
}
}),
@@ -109,6 +109,60 @@ export async function fetchReferralInvitees() {
if (response.ok) {
let parsed = await response.json();
console.log({
action: 'invitees',
token: token,
pageSize: 10,
pageNumber: 0
})
console.log(parsed);
if (parsed.message_code === 0) {
return parsed.message_body;
} else {
throw parsed;
}
} else {
throw (`${response.status}`);
}
} catch (error) {
return {
error: error
}
}
}
export async function referralRefill() {
const token = await getSessionData('token');
try {
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
method: 'POST',
body: JSON.stringify({
version: 1,
msg_id: 30003,
message_body: {
action: 'refill',
token: token,
amount: 1,
}
}),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
});
if (response.ok) {
console.log('referralRefill');
console.log({
action: 'refill',
token: token,
amount: 1,
})
let parsed = await response.json();
console.log(parsed);
if (parsed.message_code === 0) {
return parsed.message_body;