Skip to content

Commit fd892fc

Browse files
authored
Merge pull request #4 from falsepopsky/dev
fix: endpoint `/v1/games/:game_id` queries parameters
2 parents e865c3d + e170da8 commit fd892fc

File tree

8 files changed

+141
-117
lines changed

8 files changed

+141
-117
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+
```

.github/workflows/static.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Deploy static content to Pages
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
workflow_dispatch:
75

86
permissions:
97
contents: read

packages/api/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
### Major Changes
66

7-
- b21d293: This package provides access to the MobyGames API, allowing you to retrieve game data through
8-
various endpoints with optional query parameters.
7+
- b21d293: This package provides access to the MobyGames API, allowing you to retrieve game data
8+
through various endpoints with optional query parameters.
99

1010
- `/games`
1111
- `/games/:game_id`

packages/api/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
"files": [
1717
"dist"
1818
],
19+
"keywords": [
20+
"api",
21+
"database",
22+
"games",
23+
"videogames",
24+
"mobygames"
25+
],
1926
"scripts": {
2027
"clean:build": "rm -rf dist",
2128
"prebuild": "pnpm run clean:build",

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 {

packages/web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"preview": "astro preview"
1010
},
1111
"dependencies": {
12-
"@astrojs/check": "^0.5.9",
12+
"@astrojs/check": "^0.5.10",
1313
"@astrojs/starlight": "^0.21.2",
1414
"@astrojs/starlight-tailwind": "^2.0.1",
1515
"@astrojs/tailwind": "^5.1.0",
16-
"astro": "^4.5.8",
16+
"astro": "^4.5.9",
1717
"sharp": "^0.33.2",
1818
"tailwindcss": "^3.4.1",
1919
"typescript": "^5.4.3"

packages/web/src/env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/// <reference path="../.astro/types.d.ts" />
2-
/// <reference types="astro/client" />
2+
/// <reference types="astro/client" />

0 commit comments

Comments
 (0)