mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 12:19:31 +02:00
Merge branch 'DevelopMadara' of https://github.com/danilt2000/LuckyDiamond into DevelopMadara
This commit is contained in:
@@ -74,4 +74,31 @@ export async function GetChatHistory() {
|
||||
}
|
||||
}
|
||||
|
||||
export async function ApplyPromoCode(authToken, searchToken, promoCode) {
|
||||
const data = {
|
||||
userCredentials: {
|
||||
searchToken: searchToken,
|
||||
authtoken: authToken
|
||||
},
|
||||
promoCode: promoCode
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await fetch(`${BackendApiUrl}/PromoCode/ApplyPromo`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
redirect: "follow"
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
console.log("Fetch error:", response.status);
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.log("Fetch error:", error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user