fix: consolidate WeaponKey type definition
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
c750f5b069
commit
e52f6ef479
2 changed files with 6 additions and 3 deletions
|
|
@ -167,10 +167,13 @@ export interface Awakening {
|
||||||
// WeaponKey entity
|
// WeaponKey entity
|
||||||
export interface WeaponKey {
|
export interface WeaponKey {
|
||||||
id: string
|
id: string
|
||||||
|
granblue_id: string
|
||||||
name: LocalizedName
|
name: LocalizedName
|
||||||
slug: string
|
slug: string
|
||||||
keyType: string
|
series: number[]
|
||||||
slot: number
|
slot: number
|
||||||
|
group: number
|
||||||
|
order: number
|
||||||
}
|
}
|
||||||
|
|
||||||
// SimpleAxSkill for weapon AX skills
|
// SimpleAxSkill for weapon AX skills
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Awakening } from '$lib/types/Awakening'
|
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'
|
import type { SimpleAxSkill } from '$lib/types/SimpleAxSkill'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -41,7 +41,7 @@ export function getWeaponKeyImage(
|
||||||
|
|
||||||
// Handle element-specific telumas (Draconic weapons)
|
// Handle element-specific telumas (Draconic weapons)
|
||||||
const elementalTelumas = [15008, 16001, 16002]
|
const elementalTelumas = [15008, 16001, 16002]
|
||||||
const granblueId = parseInt(key.granblueId || '0')
|
const granblueId = parseInt(key.granblue_id || '0')
|
||||||
|
|
||||||
if (elementalTelumas.includes(granblueId) && weaponElement) {
|
if (elementalTelumas.includes(granblueId) && weaponElement) {
|
||||||
filename += `-${weaponElement}`
|
filename += `-${weaponElement}`
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue