create utility types on server - include Account with Membership - start moving account functions to store actions

This commit is contained in:
Michael Dausmann
2023-02-20 00:21:56 +11:00
parent b3ee03b5c3
commit fbe2436231
6 changed files with 65 additions and 29 deletions

View File

@@ -14,11 +14,6 @@
await store.initUser();
})
async function changeAccountPlan(){
const { data: account } = await $client.userAccount.changeAccountPlan.useQuery();
console.log(`account with updated plan: ${JSON.stringify(account)}`);
}
async function joinUserToAccount(){
const { data: membership } = await $client.userAccount.joinUserToAccount.useQuery();
console.log(`added membership on current account: ${JSON.stringify(membership)}`);
@@ -39,7 +34,7 @@
<h3>Notes Dashboard</h3>
<p v-for="note in notes">{{ note.note_text }}</p>
<button @click.prevent="changeAccountPlan()">Change Account Plan</button>
<button @click.prevent="store.changeAccountPlan(2)">Change Account Plan to 2</button>
<button @click.prevent="joinUserToAccount()">Join user to account</button>
<button @click.prevent="changeUserAccessWithinAccount()">Change user access within account</button>
<button @click.prevent="claimOwnershipOfAccount()">Claim Account Ownership</button>