feat: initial commit

This commit is contained in:
Christy Jacob
2024-07-23 23:48:18 +04:00
parent 87367b8950
commit 9484b38248
@@ -12,6 +12,7 @@
import { isCloud } from '$lib/system';
import { plansInfo } from '$lib/stores/billing';
import { formatCurrency } from '$lib/helpers/numbers';
import InputSelect from '$lib/elements/forms/inputSelect.svelte';
export let showCreate = false;
@@ -20,13 +21,36 @@
const url = `${$page.url.origin}/invite`;
$: plan = $plansInfo?.get($organization?.billingPlan);
let email: string, name: string, error: string;
let email: string, name: string, error: string, role: string = 'owner';
const roles = [
{
label: 'Owner',
value: 'owner'
},
{
label: 'Developer',
value: 'developer'
},
{
label: 'Editor',
value: 'editor'
},
{
label: 'Analyst',
value: 'analyst'
},
{
label: 'Billing',
value: 'billing'
}
];
async function create() {
try {
const team = await sdk.forConsole.teams.createMembership(
$organization.$id,
['owner'],
[role],
email,
undefined,
undefined,
@@ -81,6 +105,11 @@
label="Name (optional)"
placeholder="Enter name"
bind:value={name} />
<InputSelect
id="role"
label="Role"
options={roles}
bind:value={role} />
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>