add customer api

This commit is contained in:
2019-10-08 22:33:25 +02:00
committed by Roland Schneider
parent 9aee187d11
commit 1300bfc752
33 changed files with 1164 additions and 246 deletions

View File

@@ -67,7 +67,7 @@ registerLocaleData(localeHu, 'hu');
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
// provider used to create fake backend
fakeBackendProvider
// fakeBackendProvider
],
bootstrap: [AppComponent]
})

View File

@@ -18,7 +18,7 @@ export class AuthenticationService {
// login
login(username: string, password:string){
return this.http.post<any>(Endpoints.POST_USERS_AUTHENTICATE(), {username,password})
return this.http.post<any>(Endpoints.POST_USERS_AUTHENTICATE(), {username:username,password:password})
.pipe(
// the backend service sends an instance of the user
// user: any (because .post<any>)

View File

@@ -2,11 +2,11 @@ import {Observable} from "rxjs";
import {EventType} from "./event.service";
export class Endpoints {
private static contextPath = "http://localhost/api";
private static baseUrl: string = Endpoints.contextPath + "/rest/web/index.php?r=";
private static contextPath = "http://localhost:86/fitness_web";
private static baseUrl: string = Endpoints.contextPath + "/customerapi/web/index.php?r=";
public static POST_USERS_AUTHENTICATE(){
return `${this.baseUrl}/users/authenticate`;
return `${this.baseUrl}user/login`;
}
public static GET_EVENTS( ){

View File

@@ -53,15 +53,21 @@ export interface Event {
reservationCount: number;
eventType: EventType;
reservedAt: number;
room: Room;
}
export interface Room {
id: number;
name: string;
seat_count: number;
}
export interface EventType {
id: number;
name: string;
}
export interface DayToDisplay {
date: number;
date: number; //seconds
active: true;
events: Event[];
}