diff --git a/frontend/src/lib/i18n/locales/en.json b/frontend/src/lib/i18n/locales/en.json index 1a0e14c75d..abc3d090a1 100644 --- a/frontend/src/lib/i18n/locales/en.json +++ b/frontend/src/lib/i18n/locales/en.json @@ -152,6 +152,12 @@ the [Linguistics Institute at Payap University](https://li.payap.ac.th/) in Chia "created_at": "Created", "members": "Members" }, + "create": { + "title": "Create Organization", + "name": "Name", + "name_missing": "Organization name required", + "submit": "Create Organization", + } }, "project": { "create": { diff --git a/frontend/src/routes/(authenticated)/org/create/+page.svelte b/frontend/src/routes/(authenticated)/org/create/+page.svelte new file mode 100644 index 0000000000..51ab2fdb4e --- /dev/null +++ b/frontend/src/routes/(authenticated)/org/create/+page.svelte @@ -0,0 +1,38 @@ + + + +
+ + + + + {$t('org.create.submit')} + + +
diff --git a/frontend/src/routes/(authenticated)/org/create/+page.ts b/frontend/src/routes/(authenticated)/org/create/+page.ts new file mode 100644 index 0000000000..7996e362e2 --- /dev/null +++ b/frontend/src/routes/(authenticated)/org/create/+page.ts @@ -0,0 +1,22 @@ +import {getClient, graphql} from '$lib/gql'; +import type {CreateOrganizationInput, CreateOrgMutation} from '$lib/gql/generated/graphql'; +import type {$OpResult} from '$lib/gql/types'; + +export async function _createOrg(input: CreateOrganizationInput): $OpResult { + const result = await getClient().mutation( + graphql(` + mutation createOrg($input: CreateOrganizationInput!) { + createOrganization(input: $input) { + organization { + id + } + errors { + ... on DbError { + code + } + } + } + } + `), {input}); + return result; +}