Se suben eventos a la BD, asociados a la discoteca del usuario
This commit is contained in:
@@ -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){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user