diff --git a/src/api.ts b/src/api.ts index 9d349fd..51c6a17 100644 --- a/src/api.ts +++ b/src/api.ts @@ -32,7 +32,7 @@ class Model { } } - protected async create(endpoint: string, data: any) { + static async create(endpoint: string, data: any) { const init = { headers: new Headers(), method: "post", @@ -62,14 +62,18 @@ export class User extends Model implements UserData { super(); } + static async confirm(uid: string, token: string): Promise { + await super.create("users/activation", { uid, token }); + } + async login(): Promise { - await super.create("token/login", { + await Model.create("token/login", { email: this.email, password: this.password, }); } async signup(): Promise { - await super.create("users", { email: this.email, password: this.password }); + await Model.create("users", { email: this.email, password: this.password }); } } diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 840640f..2c82afb 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -3,7 +3,7 @@