Merge remote-tracking branch 'origin/matias'
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
<a class="list-group-item list-group-item-action list-group-item-light p-3" routerLinkActive="active" routerLink="agregar.usu">Usuarios</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page content wrapper-->
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
|
||||
Agregar
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<img class="d-block w-100" src="https://i0.wp.com/www.4tomono.com/wp-content/uploads/2019/05/525624-PIYDKD-830-e1558385185407.jpg?resize=1110%2C600&ssl=1" alt="First slide">
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img class="d-block w-100" src="https://lh3.googleusercontent.com/proxy/AYysTpSD-uZC01nfihT0-wx7rViJafQMfj_3vFfOcu95Y8A68uaDQDNQk7_G5rnLNuu2ldjTlfgvol5_lcY1Fp7jJxw-9wKOIlYBkKilw-r7wTXd_KOwP2DXR83xMFzLoq2NmrZYMOo5KdPgVNRg1DeU7yPM2ntln5OxtJBwRwU" alt="Second slide">
|
||||
<img class="d-block w-100" src="https://media.elmostrador.cl/2020/06/Opcion-2-468x268.jpg" alt="Second slide">
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img class="d-block w-100" src="https://static.hosteltur.com/app/public/uploads/img/articles/2018/06/01/L_5c1a9bbb04770_Central-001.jpg" alt="Third slide">
|
||||
|
||||
@@ -28,9 +28,23 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<pre *ngIf="auth.user$ | async as user">
|
||||
<code>{{user | json}}</code>
|
||||
|
||||
|
||||
|
||||
|
||||
<pre *ngIf="dato">
|
||||
<code>{{dato | json}}</code>
|
||||
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table class="table table-bordered table-hover" *ngIf="usuarios" border="2">
|
||||
<thead >
|
||||
<tr>
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user