Skip to content

Commit

Permalink
fix(itemservice): add missing generationIntroduced field
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Nov 23, 2019
1 parent 496e17b commit cf40973
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/services/ItemSerivce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default class ItemService {
itemEntry.name = itemData.name;
itemEntry.shortDesc = itemData.shortDesc;
itemEntry.isNonstandard = itemData.isNonstandard;
itemEntry.generationIntroduced = itemData.gen;
itemEntry.sprite = `https://play.pokemonshowdown.com/sprites/itemicons/${Util.toLowerHyphenCase(itemData.name)}.png`;
itemEntry.bulbapediaPage = `https://bulbapedia.bulbagarden.net/wiki/${Util.toTitleSnakeCase(itemData.name)}`;
itemEntry.serebiiPage = `https://www.serebii.net/itemdex/${Util.toLowerSingleWordCase(itemData.name)}.shtml`;
Expand Down
5 changes: 4 additions & 1 deletion src/structures/ItemEntry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Field, ObjectType } from 'type-graphql';
import { Field, ObjectType, Int } from 'type-graphql';

@ObjectType({ description: 'A single item entry' })
export default class ItemEntry {
Expand All @@ -17,6 +17,9 @@ export default class ItemEntry {
@Field(() => String, { description: 'The sprite for an item' })
sprite: string;

@Field(() => Int, { description: 'The generation in which this item was introduced' })
generationIntroduced: number;

@Field(() => String, { description: 'Bulbapedia page for an item' })
bulbapediaPage: string;

Expand Down

0 comments on commit cf40973

Please sign in to comment.