gamebox-dev / gamebox-api

API for managing a game collection
GNU Affero General Public License v3.0
0 stars 2 forks source link

Add an API endpoint which adds an external game to the collection #11

Closed FusTaFah closed 6 days ago

FusTaFah commented 1 week ago

We need an endpoint, something like POST /games/collection, which takes an external game ID and platform ID and adds it to the collection. This is going to require creating a database which will allow us to persist the data.

Also, this may be a bit weird but I have this idea of separating the game data and the collection into separate models. A games table should contain:

Then we have a collection table which just contains a list of the game IDs that are in the collection. Let's make everything work with a single collection across the entire app for now and then add in user accounts later.

The endpoint should return a 201 response if the game was added to the collection and a 200 response if the game already exists. The response body should be the game data of the added game.

michaelenger commented 6 days ago

We're going to be doing something different, so closing this.