WIP: DataSets Module

This commit is contained in:
2022-12-11 23:40:16 +01:00
parent d69d571393
commit 120abcaf1d
38 changed files with 1123 additions and 35 deletions

View File

@@ -1,15 +1,15 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { User } from '../models/user';
import { User } from '../models/user.model';
@Injectable({
providedIn: 'root'
})
export class AuthService {
apiToken: string | null = null;
user: User | null = null;
apiToken!: string;
user!: User;
constructor(
private http$: HttpClient
@@ -35,7 +35,7 @@ export class AuthService {
const header = new HttpHeaders().set('Content-type', 'application/json');
this.http$.post<any>(`${environment.api.url}/auth/apiToken`, JSON.stringify(credentials), { headers: header }).subscribe({
next: (data) => {
if (this.user) { this.user.id = data.id }
this.user.id = data.id;
this.apiToken = data.token;
resolve(data);
},