diff --git a/.changes/org-create.md b/.changes/org-create.md new file mode 100644 index 0000000..9848b3a --- /dev/null +++ b/.changes/org-create.md @@ -0,0 +1,5 @@ +--- +"algohub": patch:feat +--- + +Created a new org create page. \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d6a4cba..58e1a53 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1007,6 +1007,9 @@ packages: '@types/nprogress@0.2.3': resolution: {integrity: sha512-k7kRA033QNtC+gLc4VPlfnue58CM1iQLgn1IMAU8VPHGOj7oIHPp9UlhedEnD/Gl8evoCjwkZjlBORtZ3JByUA==} + '@types/nprogress@0.2.3': + resolution: {integrity: sha512-k7kRA033QNtC+gLc4VPlfnue58CM1iQLgn1IMAU8VPHGOj7oIHPp9UlhedEnD/Gl8evoCjwkZjlBORtZ3JByUA==} + '@types/object-path@0.11.4': resolution: {integrity: sha512-4tgJ1Z3elF/tOMpA8JLVuR9spt9Ynsf7+JjqsQ2IqtiPJtcLoHoXcT6qU4E10cPFqyXX5HDm9QwIzZhBSkLxsw==} @@ -4591,6 +4594,8 @@ snapshots: '@types/nprogress@0.2.3': {} + '@types/nprogress@0.2.3': {} + '@types/object-path@0.11.4': {} '@types/path-browserify@1.0.3': {} diff --git a/src/scripts/api.ts b/src/scripts/api.ts index d42cff9..bac05e8 100644 --- a/src/scripts/api.ts +++ b/src/scripts/api.ts @@ -246,4 +246,23 @@ export const fetchRanks = async (id: string, auth: Credentials) => { } catch (error) { return handleAxiosError(AxiosError.from(error)); } -} \ No newline at end of file +} + +interface OrganizationData { + name: string; + display_name: string; + description: string; +} + +export const createOrganization = async (auth: Credentials, form: OrganizationData) => { + try { + const response = await axios.post("/org/create", { + id: auth.id, + token: auth.token, + org: form, + }); + return response.data as Response; + } catch (error) { + return handleAxiosError(AxiosError.from(error)); + } +}; diff --git a/src/views/org/create.vue b/src/views/org/create.vue new file mode 100644 index 0000000..3687125 --- /dev/null +++ b/src/views/org/create.vue @@ -0,0 +1,132 @@ + + + + +