probando tokenizacion en el front

This commit is contained in:
Guerrero 2024-06-20 09:30:30 +02:00
parent dd43c76111
commit 92779fbbf0
5 changed files with 10 additions and 9 deletions

View File

@ -30,7 +30,7 @@ const routes = [
{ path: '/', redirect: '/jugadores'},
{ path: '/partidos', component: Partidos, name: 'partidos' },
{ path: '/jugadores', component: Jugadores, name: 'jugadores' },
{ path: '/landingPage/:id', component: LandingPage, name: 'landingPage' },
{ path: '/landingPage/:token', component: LandingPage, name: 'landingPage' },
{ path: '/:pathMatch(.*)', component: NotFound, name: 'notfound'}
]

View File

@ -40,8 +40,8 @@ export function getPartidos() {
return llamadaAPI('get', null, API_PARTIDOS)
}
export function getPartido(id) {
const url = `${API_PARTIDOS}/${id}`
export function getPartido(token) {
const url = `${API_PARTIDOS}/search/findByToken?token=${token}`
return llamadaAPI('get', null, url)
}

View File

@ -52,10 +52,11 @@ export const usePartidosAPIStore = defineStore("partidosAPI", {
async cargarPartidos() {
return await this.cargarPartidosGenerales(getPartidos, "partidos")
},
async cargarPartido(id) {
const response = await getPartido(id)
async cargarPartido(token) {
const response = await getPartido(token)
const partido = response.data
const puntuacionesResponse = await getPartidoPuntuaciones(id)
const partidoId = this.obtenerId(partido)
const puntuacionesResponse = await getPartidoPuntuaciones(partidoId)
const puntuaciones = puntuacionesResponse.data._embedded.puntuaciones
partido.puntuaciones = puntuaciones
this.partidoCompleto = partido

View File

@ -70,7 +70,7 @@ export default {
this.$router.go(-1)
},
async cargarDatosPartido() {
await this.cargarPartido(this.$route.params.id)
await this.cargarPartido(this.$route.params.token)
if (this.partidoCompleto) {
this.campoSeleccionado = this.campos.find(campo => campo.nombre == this.partidoCompleto.nombreCampo)
this.fecha = this.partidoCompleto.cuando.split('T')[0]

View File

@ -54,8 +54,8 @@ public class EmailInicializerService {
String rechazarInvitacionUrl = direccionAPI + "puntuaciones/search/actualizarAsistencia?id=" + puntuacion1Id + "&aceptado=false";
String aceptarIntercambioUrl = direccionAPI + "puntuaciones/search/actualizarCompartidoTelefono?id=" + puntuacion1Id + "&compartidoTelefono=true";
String rechazarIntercambioUrl = direccionAPI + "puntuaciones/search/actualizarCompartidoTelefono?id=" + puntuacion1Id + "&compartidoTelefono=false";
String introducirDetallesPartidoURL = direccionApp + "#/landingPage/" + partidoId;
// String introducirDetallesPartidoURL = direccionApp + "#/landingPage/" + partidoToken;
// String introducirDetallesPartidoURL = direccionApp + "#/landingPage/" + partidoId;
String introducirDetallesPartidoURL = direccionApp + "#/landingPage/" + partidoToken;
Map<String, Object> variables = new HashMap<>();
variables.put("emailJugador1", emailJugador1);