Add latest changes from frontend branch

This commit is contained in:
kevinpauer
2022-04-05 19:29:30 +02:00
28 changed files with 820 additions and 116 deletions

View File

@@ -1,7 +1,8 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
const AUTH_API = 'https://aktienbot.flokaiser.com/api/user/';
const AUTH_API = 'https://gruppe1.testsites.info/api/user';
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
};
@@ -11,12 +12,25 @@ const httpOptions = {
})
export class AuthService {
constructor(private http: HttpClient) {}
/**
* @param {string} email
* @param {string} password
* @returns Observable
*/
login(email: string, password: string): Observable<any> {
return this.http.post(AUTH_API + '/login', {
email,
password,
});
}
/**
* @param {string} email
* @param {string} username
* @param {string} password
* @returns Observable
*/
register(email: string, username: string, password: string): Observable<any> {
return this.http.post(
AUTH_API + '/register',