diff --git a/src/commands/gxgames/command.ts b/src/commands/gxgames/command.ts index 1099f1a..94ca685 100644 --- a/src/commands/gxgames/command.ts +++ b/src/commands/gxgames/command.ts @@ -87,10 +87,17 @@ const gxgamesMetaCommand = buildCommand({ optional: true, }, ageRating: { - kind: "parsed", - parse: String, - brief: - "Age rating: NOT_SET, EVERYONE, CHILDREN, EARLY_TEENS, TEENS, ADULTS, MATURE", + kind: "enum", + values: [ + "NOT_SET", + "EVERYONE", + "CHILDREN", + "EARLY_TEENS", + "TEENS", + "ADULTS", + "MATURE", + ], + brief: "Age rating", optional: true, }, description: { diff --git a/src/commands/gxgames/commands/meta-impl.ts b/src/commands/gxgames/commands/meta-impl.ts index 7f58dd5..fecaf7e 100644 --- a/src/commands/gxgames/commands/meta-impl.ts +++ b/src/commands/gxgames/commands/meta-impl.ts @@ -29,7 +29,7 @@ import type { interface MetaFlags { title?: string; - ageRating?: string; + ageRating?: GameDevUpdateGameRequestAgeRatingEnum; description?: string; platforms?: string; cover?: string; @@ -58,11 +58,7 @@ export default async function ( const updateData: GameDevUpdateGameRequest = { title: flags.title ?? game.title, shortDescription: flags.description ?? game.shortDescription, - ageRating: - (flags.ageRating?.toUpperCase() as - | GameDevUpdateGameRequestAgeRatingEnum - | undefined) ?? - (game.ageRating as GameDevUpdateGameRequestAgeRatingEnum), + ageRating: flags.ageRating ?? game.ageRating, platforms: flags.platforms ?.split(",")