Enables equity eligibility for users
Allows superusers to grant and revoke equity eligibility for users. Adds UI components for managing equity eligibility. Equity-eligible users can then contribute expenses as equity.
This commit is contained in:
parent
33c294de7f
commit
eefabc3441
4 changed files with 338 additions and 1 deletions
|
|
@ -15,6 +15,7 @@ window.app = Vue.createApp({
|
|||
users: [],
|
||||
settings: null,
|
||||
userWalletSettings: null,
|
||||
userInfo: null, // User information including equity eligibility
|
||||
isAdmin: false,
|
||||
isSuperUser: false,
|
||||
castleWalletConfigured: false,
|
||||
|
|
@ -353,6 +354,19 @@ window.app = Vue.createApp({
|
|||
console.error('Error loading users:', error)
|
||||
}
|
||||
},
|
||||
async loadUserInfo() {
|
||||
try {
|
||||
const response = await LNbits.api.request(
|
||||
'GET',
|
||||
'/castle/api/v1/user/info',
|
||||
this.g.user.wallets[0].inkey
|
||||
)
|
||||
this.userInfo = response.data
|
||||
} catch (error) {
|
||||
console.error('Error loading user info:', error)
|
||||
this.userInfo = { is_equity_eligible: false }
|
||||
}
|
||||
},
|
||||
async loadSettings() {
|
||||
try {
|
||||
// Try with admin key first to check settings
|
||||
|
|
@ -1457,6 +1471,7 @@ window.app = Vue.createApp({
|
|||
// Load settings first to determine if user is super user
|
||||
await this.loadSettings()
|
||||
await this.loadUserWallet()
|
||||
await this.loadUserInfo()
|
||||
await this.loadExchangeRate()
|
||||
await this.loadBalance()
|
||||
await this.loadTransactions()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue