diff --git a/frontend/src/app/app.component.html b/frontend/src/app/app.component.html
index cd522da..9f601f6 100644
--- a/frontend/src/app/app.component.html
+++ b/frontend/src/app/app.component.html
@@ -7,7 +7,6 @@
Usuarios
-
diff --git a/frontend/src/app/components/agregar-res/agregar-res.component.html b/frontend/src/app/components/agregar-res/agregar-res.component.html
index 018bde3..a3f3010 100644
--- a/frontend/src/app/components/agregar-res/agregar-res.component.html
+++ b/frontend/src/app/components/agregar-res/agregar-res.component.html
@@ -16,6 +16,9 @@
+
diff --git a/frontend/src/app/components/public/public.component.html b/frontend/src/app/components/public/public.component.html
index e463b24..9c95b6c 100644
--- a/frontend/src/app/components/public/public.component.html
+++ b/frontend/src/app/components/public/public.component.html
@@ -9,7 +9,7 @@
-

+

diff --git a/frontend/src/app/components/sectores/sectores.component.html b/frontend/src/app/components/sectores/sectores.component.html
index 983874d..3e86751 100644
--- a/frontend/src/app/components/sectores/sectores.component.html
+++ b/frontend/src/app/components/sectores/sectores.component.html
@@ -28,9 +28,23 @@
-
-{{user | json}}
+
+
+
+
+
+{{dato | json}}
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/app/components/sectores/sectores.component.ts b/frontend/src/app/components/sectores/sectores.component.ts
index c2cedd1..eaf881d 100644
--- a/frontend/src/app/components/sectores/sectores.component.ts
+++ b/frontend/src/app/components/sectores/sectores.component.ts
@@ -23,21 +23,17 @@ export class SectoresComponent implements OnInit {
ngOnInit(): void {
this.auth.user$
.pipe(
- tap((user)=>console.log(user)),
+
concatMap((user)=>
- this.http.get(`https://api.unified.restaurant/api/v1/users/${user?.sub}`)
+ this.http.get(`https://api.unified.restaurant/api/v1/users/${user?.sub}/restaurantes`)
),
tap((userdato) =>(this.dato = userdato))
- ).subscribe();
+ ).subscribe()
+
console.log();
- this.recuperarUsuarios();
+
}
- recuperarUsuarios(){
- this.restaurantServ.mostrarUsuarios().subscribe(algo => {
-
- })
- }
}
diff --git a/frontend/src/app/restaurantes.service.ts b/frontend/src/app/restaurantes.service.ts
index 44e738f..49a53b0 100644
--- a/frontend/src/app/restaurantes.service.ts
+++ b/frontend/src/app/restaurantes.service.ts
@@ -2,18 +2,18 @@ import { Injectable } from '@angular/core';
import {HttpClient, HttpHeaders} from "@angular/common/http";
import {AuthService} from "@auth0/auth0-angular";
-import {concatMap, tap} from "rxjs/operators";
+import {tap} from "rxjs/operators";
@Injectable({
providedIn: 'root'
})
export class RestaurantesService {
-
- url='https://api.unified.restaurant/api/v1';
dato:any;
+ url='https://api.unified.restaurant/api/v1';
- constructor(private http: HttpClient,public auth: AuthService) { }
+
+ constructor(private http: HttpClient , public auth: AuthService) { }
mostrarTodosRes(){
return this.http.get(`${this.url}/restaurantes`);
@@ -36,7 +36,6 @@ export class RestaurantesService {
}
-
//CRUD DE USUARIOS
mostrarUsuarios(){
return this.http.get(`${this.url}/users`);
@@ -72,14 +71,21 @@ export class RestaurantesService {
return this.http.delete(`${this.url}/${codigoRes}/sectores/${codigoSec}`);
}
- modificarSec(codigoRes:any,codifoSec:any,SectoresModificar:any){
- const headers: HttpHeaders = new HttpHeaders({
- 'Content-Type': 'application/json'
- });
- return this.http.put(`${this.url}/${codigoRes}/sectores/${codifoSec}`, JSON.stringify(SectoresModificar),{headers: headers});
+
+ //Loggion user
+ Pruebadealgo() {
+
+ this.auth.user$.pipe(user=>this.http.get(`https://api.unified.restaurant/api/v1/users/${user}/restaurantes`)),
+ tap((userdato) =>(this.dato = userdato))
+
+ return this.dato;
+
+
}
+
+
}