This commit is contained in:
Rutra
2026-05-13 11:50:22 +02:00
commit 2068229f89
128 changed files with 9215 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import Game from '#models/game';
export default class GamesController {
async index({}) {
return Game.query().orderBy('sort_order', 'asc');
}
async store({ request }) {
const data = request.only(['name', 'icon', 'type', 'sortOrder']);
return Game.create(data);
}
async update({ params, request }) {
const game = await Game.findOrFail(params.id);
const data = request.only(['name', 'icon', 'type', 'sortOrder']);
game.merge(data);
await game.save();
return game;
}
async destroy({ params, response }) {
const game = await Game.findOrFail(params.id);
await game.delete();
return response.noContent();
}
}
//# sourceMappingURL=games_controller.js.map