From b8bbfff3817cb602b90e203f051b87d84b6aaffa Mon Sep 17 00:00:00 2001 From: garionion Date: Sun, 4 Apr 2021 14:27:19 +0200 Subject: [PATCH] add Site creating Signed-off-by: garionion --- src/api/index.ts | 2 +- src/api/types.ts | 2 +- src/views/Sites.vue | 56 +++++++++++++++++++++++++++++++++++++++------ 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 17e082d..fc734ea 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -99,5 +99,5 @@ export async function getSites(): Promise { } export async function createSite(site: Site) { - return request("/sites", { auth: true, method: HTTPMethod.POST }); + return request("/sites", { auth: true, method: HTTPMethod.POST }, site); } diff --git a/src/api/types.ts b/src/api/types.ts index 13e4541..8e1d705 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -12,7 +12,7 @@ export interface LoginResponse { export interface Site { default_prefix: string; - id: number; + id?: number; name: string; } diff --git a/src/views/Sites.vue b/src/views/Sites.vue index b739e36..9dc9c2a 100644 --- a/src/views/Sites.vue +++ b/src/views/Sites.vue @@ -35,29 +35,71 @@ class="dark:text-white container mx-auto h-full flex justify-center items-center mt-12" >

New Site

-
+ +