Se suben eventos a la BD, asociados a la discoteca del usuario

This commit is contained in:
2021-03-20 13:21:50 +01:00
parent f6756c25a8
commit 4b2d8cf7b6
8 changed files with 102 additions and 19 deletions

View File

@@ -8,6 +8,7 @@ import { NumericValueAccessor } from '@ionic/angular';
import { DiscotecaI } from '../interfaces/discoteca-i';
import { ApiService } from '../services/api.service';
import { Router } from '@angular/router';
import { Eventoi } from '../interfaces/eventoi';
@Injectable({
@@ -33,6 +34,7 @@ export class Tab1Service implements OnInit{
initValues(): void{
this.discoteca = new Discoteca();
this.discoteca.setId(this.discotecaI.discotecaID);
this.discoteca.setNombre(this.discotecaI.nombre);
this.discoteca.setTelefono(this.discotecaI.telefono);
this.discoteca.setLocalizacion(this.discotecaI.localizacion);
@@ -89,4 +91,16 @@ export class Tab1Service implements OnInit{
}
}
postEvento(evento: Eventoi){
this.apiService.postEvento(evento)
.subscribe(evento => {
this.router.navigate(['/tabs']);
})
}
updateEvento(evento: Eventoi){
}
}