reorganización con carpetas
This commit is contained in:
38
src/app/services/api.service.ts
Normal file
38
src/app/services/api.service.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable, throwError, BehaviorSubject } from 'rxjs';
|
||||
import { catchError, retry, map, tap } from 'rxjs/operators';
|
||||
import { User } from '../interfaces/user';
|
||||
import { Discoteca } from '../discoteca';
|
||||
import { UserLogin } from '../interfaces/user-login';
|
||||
import { DiscotecaI } from '../interfaces/discoteca-i';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ApiService {
|
||||
|
||||
baseUrl = "http://localhost:3307/api/consultas";
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
validateUser(user: UserLogin): Observable<User>{
|
||||
|
||||
return this.http.post<User>(this.baseUrl+"/users", user)
|
||||
|
||||
}
|
||||
|
||||
getUserDiscoteca(discotecaId: number): Observable<DiscotecaI>{
|
||||
|
||||
return this.http.post<DiscotecaI>(this.baseUrl+"/discoteca", { "id": discotecaId});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user