diff --git a/schemas/players.json b/schemas/players.json index c476cb0..4fc67ea 100644 --- a/schemas/players.json +++ b/schemas/players.json @@ -9,7 +9,7 @@ "type": "string", "default": "" }, - "team": { + "name": { "type": "string", "default": "" }, @@ -17,36 +17,21 @@ "type": "string", "default": "" }, + "team": { + "type": "string", + "default": "" + }, "twitter": { "type": "string", "default": "" - }, - "realName": { - "type": "string", - "default": "" - }, - "pronouns": { - "type": "string", - "default": "" - }, - "twitch": { - "type": "string", - "default": "" - }, - "notes": { - "type": "string", - "default": "" } }, "required": [ "gamertag", - "team", + "name", "country", - "twitter", - "realName", - "pronouns", - "twitch", - "notes" + "team", + "twitter" ] }, "default": {} diff --git a/src/dashboard/example/stores/players.ts b/src/dashboard/example/stores/players.ts index 6bfd0c1..d079b22 100644 --- a/src/dashboard/example/stores/players.ts +++ b/src/dashboard/example/stores/players.ts @@ -12,13 +12,10 @@ const normalizePlayer = (input: unknown): Player => { const candidate = typeof input === 'object' && input !== null ? (input as Record) : {}; return { gamertag: typeof candidate.gamertag === 'string' ? candidate.gamertag : '', + name: typeof candidate.name === 'string' ? candidate.name : '', team: typeof candidate.team === 'string' ? candidate.team : '', country: typeof candidate.country === 'string' ? candidate.country : '', twitter: typeof candidate.twitter === 'string' ? candidate.twitter : '', - realName: typeof candidate.realName === 'string' ? candidate.realName : '', - pronouns: typeof candidate.pronouns === 'string' ? candidate.pronouns : '', - twitch: typeof candidate.twitch === 'string' ? candidate.twitch : '', - notes: typeof candidate.notes === 'string' ? candidate.notes : '', }; }; diff --git a/src/dashboard/example/views/Players.vue b/src/dashboard/example/views/Players.vue index 6342364..f7fb9dd 100644 --- a/src/dashboard/example/views/Players.vue +++ b/src/dashboard/example/views/Players.vue @@ -25,13 +25,10 @@ const fileInput = ref(null); const emptyPlayer: Player = { gamertag: '', - team: '', + name: '', country: '', + team: '', twitter: '', - realName: '', - pronouns: '', - twitch: '', - notes: '', }; const form = reactive({ ...emptyPlayer }); @@ -88,7 +85,8 @@ const openCreateDialog = () => { const openEditDialog = (row: PlayerRow) => { editingId.value = row.id; - const { id: _id, ...playerData } = row; + const { id, ...playerData } = row; + void id; Object.assign(form, playerData); isDialogOpen.value = true; }; @@ -132,7 +130,7 @@ const handleImport = async (event: Event) => { const text = await file.text(); const parsed = JSON.parse(text) as unknown; playersStore.setPlayers(parsed as PlayersMap); - } catch (error) { + } catch { window.alert('No se pudo importar el JSON. Verifica el formato.'); } finally { if (target) { @@ -242,8 +240,8 @@ const handleImport = async (event: Event) => {
@@ -268,6 +266,14 @@ const handleImport = async (event: Event) => { outlined />
+
+ +
{ outlined />
-
- -
-
- -
-
- -
-
- -
diff --git a/src/types/schemas/players.d.ts b/src/types/schemas/players.d.ts index 51df0c0..f8602c4 100644 --- a/src/types/schemas/players.d.ts +++ b/src/types/schemas/players.d.ts @@ -9,12 +9,9 @@ export interface Players { [k: string]: { gamertag: string; - team: string; + name: string; country: string; + team: string; twitter: string; - realName: string; - pronouns: string; - twitch: string; - notes: string; }; }