@golstats/gsc-reports 1.0.84 → 1.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golstats/gsc-reports",
3
- "version": "1.0.84",
3
+ "version": "1.0.86",
4
4
  "main": "dist/gsc-reports.umd.js",
5
5
  "module": "dist/gsc-reports.es.js",
6
6
  "exports": {
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@golstats/gsc-checkbox": "^1.0.13",
50
- "@golstats/gsc-template-report-maker": "^1.0.117",
50
+ "@golstats/gsc-template-report-maker": "^1.0.119",
51
51
  "axios": "^1.10.0",
52
52
  "gridstack": "^12.1.1",
53
53
  "tiny-emitter": "^2.1.0",
@@ -220,6 +220,11 @@ const props = defineProps({
220
220
  required: false,
221
221
  default: null,
222
222
  },
223
+ templateType: {
224
+ type: [String, Number],
225
+ required: false,
226
+ default: 1, // 1 = prepartido, 2 = postpartido
227
+ },
223
228
  })
224
229
 
225
230
  const emit = defineEmits(['update:modelValue'])
@@ -331,9 +336,9 @@ watch(
331
336
  { deep: true },
332
337
  )
333
338
 
334
- // Recargar fortalezas cuando cambien seasonId, teamId, gameId o token
339
+ // Recargar fortalezas cuando cambien seasonId, teamId, gameId, token o templateType
335
340
  watch(
336
- () => [props.seasonId, props.teamId, props.gameId, props.token],
341
+ () => [props.seasonId, props.teamId, props.gameId, props.token, props.templateType],
337
342
  () => {
338
343
  fetchFortalezas()
339
344
  },
@@ -371,9 +376,15 @@ async function fetchFortalezas() {
371
376
  error.value = null
372
377
 
373
378
  try {
374
- // Construir la URL: si hay gameId, usar la ruta con pregames, si no, usar la ruta sin pregames
375
-
376
- const url = `https://5c9xc3gwh2.execute-api.us-east-2.amazonaws.com/prod/strengths/seasons/${props.seasonId}/pregames/${props.gameId}/teams/${props.teamId}`
379
+ // Construir la URL según el tipo de template: pregames para prepartido (1), postgames para postpartido (2)
380
+ let url
381
+ if (props.templateType === 2) {
382
+ // Postpartido
383
+ url = `https://5c9xc3gwh2.execute-api.us-east-2.amazonaws.com/prod/strengths/seasons/${props.seasonId}/postgames/${props.gameId}/teams/${props.teamId}`
384
+ } else {
385
+ // Prepartido
386
+ url = `https://5c9xc3gwh2.execute-api.us-east-2.amazonaws.com/prod/strengths/seasons/${props.seasonId}/pregames/${props.gameId}/teams/${props.teamId}`
387
+ }
377
388
 
378
389
  const response = await fetch(url, {
379
390
  method: 'GET',
@@ -101,6 +101,7 @@
101
101
  :rival-team-id="props.partido?.visita || props.partido?.visiting_team"
102
102
  :game-id="props.partido?.game_id || props.partido?.id"
103
103
  :token="props.token"
104
+ :template-type="props.template?.template_type || 1"
104
105
  title="Fortalezas a favor de mi equipo"
105
106
  :total-fortalezas="fortalezasCounts.equipo"
106
107
  ref="fortalezasEquipoRef"
@@ -119,6 +120,7 @@
119
120
  :rival-team-id="props.partido?.local || props.partido?.home_team"
120
121
  :game-id="props.partido?.game_id || props.partido?.id"
121
122
  :token="props.token"
123
+ :template-type="props.template?.template_type || 1"
122
124
  title="Fortalezas a favor del rival"
123
125
  :total-fortalezas="fortalezasCounts.rival"
124
126
  ref="fortalezasRivalRef"