add customer api
This commit is contained in:
@@ -67,7 +67,7 @@ registerLocaleData(localeHu, 'hu');
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
|
||||
|
||||
// provider used to create fake backend
|
||||
fakeBackendProvider
|
||||
// fakeBackendProvider
|
||||
],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
|
||||
@@ -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>)
|
||||
|
||||
@@ -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( ){
|
||||
|
||||
@@ -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[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user