Skip to content

Commit aab8656

Browse files
authored
fix: endpoint /v1/games/:game_id queries
1 parent 5c6ee67 commit aab8656

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

.changeset/hungry-jokes-hunt.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@untidy/mobygames': patch
3+
---
4+
5+
fix: The endpoint `/v1/games/:game_id` only supports the format `brief`, `normal` and `full`. Not
6+
`id`.
7+
8+
Response from the endpoint:
9+
10+
```js
11+
12+
{
13+
code: 13,
14+
error: 'Invalid format',
15+
message: 'Output format must be one of brief, normal, or full.'
16+
}
17+
18+
```

packages/api/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export interface QueriesGamesRecent extends QueriesBase {
8484

8585
export type QueriesRandom = Omit<QueriesBase, 'offset'>;
8686

87-
export type QueriesGameById = Omit<QueriesBase, 'limit' | 'offset'>;
87+
export type QueriesGameById = Record<'format', 'normal' | 'brief' | 'full'>;
8888

8989
export interface GetGenres {
9090
genres: Genre[];
@@ -126,8 +126,8 @@ export type GetGameById<Q extends QueriesGameById> = Q['format'] extends 'normal
126126
? GameNormal
127127
: Q['format'] extends 'brief'
128128
? GameBrief
129-
: Q['format'] extends 'id'
130-
? GamesType<number>
129+
: Q['format'] extends 'full'
130+
? GameNormal
131131
: GameNormal;
132132

133133
export interface GetGamePlatforms {

0 commit comments

Comments
 (0)