fix(api): fix remaining lowercase fields in NexusWeapon
This commit is contained in:
parent
27c3e5ad6e
commit
a903a65275
|
|
@ -51,14 +51,14 @@ class NexusWeapon(NexusItem):
|
|||
@classmethod
|
||||
def from_api(cls, data: Dict[str, Any]) -> "NexusWeapon":
|
||||
"""Create from API response."""
|
||||
props = data.get('properties', {})
|
||||
props = data.get('Properties', {})
|
||||
economy = props.get('Economy', {})
|
||||
damage = props.get('Damage', {})
|
||||
|
||||
return cls(
|
||||
id=data.get('id', 0),
|
||||
name=data.get('name', 'Unknown'),
|
||||
item_id=str(data.get('id', 0)),
|
||||
id=data.get('Id', 0),
|
||||
name=data.get('Name', 'Unknown'),
|
||||
item_id=str(data.get('Id', 0)),
|
||||
category='weapon',
|
||||
damage=Decimal(str(damage.get('Total', 0))),
|
||||
decay=Decimal(str(economy.get('Decay', 0))),
|
||||
|
|
@ -68,7 +68,7 @@ class NexusWeapon(NexusItem):
|
|||
cost_per_hour=Decimal(str(economy.get('CostPerHour', 0))),
|
||||
efficiency=Decimal(str(props.get('Efficiency', 0))),
|
||||
range_val=Decimal(str(props.get('Range', 0))),
|
||||
type=data.get('type', ''),
|
||||
type=props.get('Type', ''),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue