modificacion de visual

This commit is contained in:
matias mella
2021-07-20 17:44:43 -04:00
parent 069413b577
commit bae03fb442
16 changed files with 321 additions and 105 deletions

View File

@@ -0,0 +1,49 @@
import { Component, OnInit } from '@angular/core';
import {RestaurantesService} from "../../restaurantes.service";
@Component({
selector: 'app-agregar-usuario',
templateUrl: './agregar-usuario.component.html',
styleUrls: ['./agregar-usuario.component.scss']
})
export class AgregarUsuarioComponent implements OnInit {
usuarios: any;
agreU={
nombre:null,
email:null,
username:null,
password:null,
roles:['admin'],
restaurant:null
}
modi={
nombre: null,
roles:['productor']
}
constructor(private restaurantServ : RestaurantesService) { }
ngOnInit(): void {
this.recuperarUsuarios();
}
recuperarUsuarios(){
this.restaurantServ.mostrarUsuarios().subscribe(result => this.usuarios = result)
}
AgregarUsu(){
this.restaurantServ.agregarUsu(this.agreU).subscribe(this.recuperarUsuarios)
}
eliminarUsu(id:any){
if(confirm("Esta seguro de eliminar este registro?")){
this.restaurantServ.eliminarUsu(id).subscribe();
}
}
modificarUsu(id:any){
this.restaurantServ.moficiarUsu(id,this.modi).subscribe();
}
}