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>
|
<a class="list-group-item list-group-item-action list-group-item-light p-3" routerLinkActive="active" routerLink="agregar.usu">Usuarios</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Page content wrapper-->
|
<!-- Page content wrapper-->
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
|
||||||
|
Agregar
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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">
|
<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>
|
||||||
<div class="carousel-item">
|
<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>
|
||||||
<div class="carousel-item">
|
<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">
|
<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>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<pre *ngIf="auth.user$ | async as user">
|
|
||||||
<code>{{user | json}}</code>
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre *ngIf="dato">
|
||||||
|
<code>{{dato | json}}</code>
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<table class="table table-bordered table-hover" *ngIf="usuarios" border="2">
|
<table class="table table-bordered table-hover" *ngIf="usuarios" border="2">
|
||||||
<thead >
|
<thead >
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -23,21 +23,17 @@ export class SectoresComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.auth.user$
|
this.auth.user$
|
||||||
.pipe(
|
.pipe(
|
||||||
tap((user)=>console.log(user)),
|
|
||||||
concatMap((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))
|
tap((userdato) =>(this.dato = userdato))
|
||||||
).subscribe();
|
).subscribe()
|
||||||
|
|
||||||
console.log();
|
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 {HttpClient, HttpHeaders} from "@angular/common/http";
|
||||||
import {AuthService} from "@auth0/auth0-angular";
|
import {AuthService} from "@auth0/auth0-angular";
|
||||||
import {concatMap, tap} from "rxjs/operators";
|
import {tap} from "rxjs/operators";
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class RestaurantesService {
|
export class RestaurantesService {
|
||||||
|
|
||||||
url='https://api.unified.restaurant/api/v1';
|
|
||||||
dato:any;
|
dato:any;
|
||||||
|
|
||||||
|
url='https://api.unified.restaurant/api/v1';
|
||||||
|
|
||||||
constructor(private http: HttpClient,public auth: AuthService) { }
|
|
||||||
|
constructor(private http: HttpClient , public auth: AuthService) { }
|
||||||
|
|
||||||
mostrarTodosRes(){
|
mostrarTodosRes(){
|
||||||
return this.http.get(`${this.url}/restaurantes`);
|
return this.http.get(`${this.url}/restaurantes`);
|
||||||
@@ -36,7 +36,6 @@ export class RestaurantesService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//CRUD DE USUARIOS
|
//CRUD DE USUARIOS
|
||||||
mostrarUsuarios(){
|
mostrarUsuarios(){
|
||||||
return this.http.get(`${this.url}/users`);
|
return this.http.get(`${this.url}/users`);
|
||||||
@@ -72,14 +71,21 @@ export class RestaurantesService {
|
|||||||
return this.http.delete(`${this.url}/${codigoRes}/sectores/${codigoSec}`);
|
return this.http.delete(`${this.url}/${codigoRes}/sectores/${codigoSec}`);
|
||||||
|
|
||||||
}
|
}
|
||||||
modificarSec(codigoRes:any,codifoSec:any,SectoresModificar:any){
|
|
||||||
const headers: HttpHeaders = new HttpHeaders({
|
//Loggion user
|
||||||
'Content-Type': 'application/json'
|
Pruebadealgo() {
|
||||||
});
|
|
||||||
return this.http.put(`${this.url}/${codigoRes}/sectores/${codifoSec}`, JSON.stringify(SectoresModificar),{headers: headers});
|
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