WIP: DataSets Module
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user