feat: implement membership confirmation flow and update related functionalities

This commit is contained in:
Danel Kungla
2025-07-08 15:59:08 +03:00
parent 848dbb1618
commit 10580fa653
18 changed files with 188 additions and 179 deletions

View File

@@ -47,16 +47,13 @@ class AccountsApi {
}
/**
* @name loadUserAccounts
* Load only user-owned accounts (not just memberships).
*/
* @name loadUserAccounts
* Load only user-owned accounts (not just memberships).
*/
async loadUserAccounts() {
const authUser = await this.client.auth.getUser();
const {
data,
error: userError,
} = authUser
const { data, error: userError } = authUser;
if (userError) {
throw userError;
@@ -66,14 +63,16 @@ class AccountsApi {
const { data: accounts, error } = await this.client
.from('accounts_memberships')
.select(`
.select(
`
account_id,
user_accounts (
name,
slug,
picture_url
picture_url,
)
`,
)
`)
.eq('user_id', user.id)
.eq('account_role', 'owner');
@@ -88,7 +87,6 @@ class AccountsApi {
}));
}
async loadTempUserAccounts() {
const { data: accounts, error } = await this.client
.from('user_accounts')