From e52f6ef4795bb61de33476dd3246ed2693d43561 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 28 Nov 2025 18:05:46 -0800 Subject: [PATCH] fix: consolidate WeaponKey type definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update entities.ts WeaponKey to include all required fields (granblue_id, series, group, order) - Use snake_case naming (granblue_id) to match API/database conventions - Update modifiers.ts to import from entities.ts and use snake_case property - Removes duplicate WeaponKey type and eliminates type conflicts Fixes "Property 'granblueId' does not exist on type 'WeaponKey'" and type assignment errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/lib/types/api/entities.ts | 5 ++++- src/lib/utils/modifiers.ts | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/types/api/entities.ts b/src/lib/types/api/entities.ts index 39ba3fdd..e937d35f 100644 --- a/src/lib/types/api/entities.ts +++ b/src/lib/types/api/entities.ts @@ -167,10 +167,13 @@ export interface Awakening { // WeaponKey entity export interface WeaponKey { id: string + granblue_id: string name: LocalizedName slug: string - keyType: string + series: number[] slot: number + group: number + order: number } // SimpleAxSkill for weapon AX skills diff --git a/src/lib/utils/modifiers.ts b/src/lib/utils/modifiers.ts index c1809a17..8c5d7ada 100644 --- a/src/lib/utils/modifiers.ts +++ b/src/lib/utils/modifiers.ts @@ -3,7 +3,7 @@ */ import type { Awakening } from '$lib/types/Awakening' -import type { WeaponKey } from '$lib/types/WeaponKey' +import type { WeaponKey } from '$lib/types/api/entities' import type { SimpleAxSkill } from '$lib/types/SimpleAxSkill' /** @@ -41,7 +41,7 @@ export function getWeaponKeyImage( // Handle element-specific telumas (Draconic weapons) const elementalTelumas = [15008, 16001, 16002] - const granblueId = parseInt(key.granblueId || '0') + const granblueId = parseInt(key.granblue_id || '0') if (elementalTelumas.includes(granblueId) && weaponElement) { filename += `-${weaponElement}`