diff --git a/src/api.ts b/src/api.ts index f391d6f..d046fb0 100644 --- a/src/api.ts +++ b/src/api.ts @@ -30,21 +30,20 @@ async function request( init.headers.set("Accept", "application/json"); init.headers.set("Content-Type", "application/json"); const response = await fetch(`/api/${endpoint}/`, init); - if (response.status !== 204) { - if (response.status === successStatus) { - return await response.json(); - } else { - throw new APIError(response.statusText, await response.json()); - } + const dataOrErrors = await response.json(); + if (response.status === successStatus) { + return dataOrErrors; + } else { + throw new APIError(response.statusText, dataOrErrors); } } export class User { - email: string | undefined; - password: string | undefined; + private email: string | undefined; + private password: string | undefined; private username: string | null = null; private confidantEmail: string | null = null; - isAuthenticated = false; + private isAuthenticated = false; private token = ""; static async confirm(uid: string, token: string): Promise { diff --git a/src/components/LoginForm.vue b/src/components/LoginForm.vue index 5a43caa..11844f0 100644 --- a/src/components/LoginForm.vue +++ b/src/components/LoginForm.vue @@ -24,9 +24,8 @@ diff --git a/src/views/MainPage.vue b/src/views/MainPage.vue deleted file mode 100644 index fff0df5..0000000 --- a/src/views/MainPage.vue +++ /dev/null @@ -1,39 +0,0 @@ - - -