This commit is contained in:
you 2024-12-08 13:36:43 +03:00
parent f4e7d83c28
commit 9e1bc7e957

View File

@ -27,7 +27,7 @@
// balance = Number(balance);
// bid = Number(balance);
console.log(name, surname, balance, role, bid, payout_bid);
if (isStringEmptyOrSpaces(name) || name.length < 2) {
canChangeUser = false;
return;
@ -65,11 +65,11 @@
surname: userData.surname,
balance: userData.balance.toString(),
rate: "0",
can_trade: userData["can_trade"] ? "true":"false",
can_trade_global: userData["can_trade_global"] ? "true":"false",
can_trade: userData["can_trade"] ? "true" : "false",
can_trade_global: userData["can_trade_global"] ? "true" : "false",
role: value_role,
bid: userData.bid.toString(),
payout_bid: userData.payout_bid.toString()
payout_bid: userData.payout_bid.toString(),
},
makeAuthHeaderForAxios(getAuthInfo()?.a)
);
@ -157,15 +157,31 @@
class="toggle toggle-primary"
/>
</div>
<button on:click={()=>{
changeUserInfo();
}} class="btn btn-primary text-base" disabled={changingUser || !canChangeUser}>
Сохранить
{#if changingUser}
<span class="loading loading-spinner"></span>
{/if}
<div class="flex p-4 items-center gap-2">
<p>Глобальная торговля:</p>
<input
bind:checked={userData["can_trade_global"]}
type="checkbox"
class="toggle toggle-primary"
/>
</div>
<button
on:click={() => {
changeUserInfo();
}}
class="btn btn-primary text-base"
disabled={changingUser || !canChangeUser}
>
Сохранить
{#if changingUser}
<span class="loading loading-spinner"></span>
{/if}
</button>
<a href={window.location.pathname.replace("change", "profile")} class="hidden" id="ref"></a>
<a
href={window.location.pathname.replace("change", "profile")}
class="hidden"
id="ref"
></a>
</div>
</div>
</div>