feat: allow admins to edit the "owned" status of games

This commit is contained in:
Manuel Weiser 2024-09-02 11:43:41 +02:00
parent c49db43a43
commit 1586309d3a

View File

@ -110,6 +110,7 @@ def edit_game(game_id):
return jsonify({'message': 'Game not found!'}), 404 return jsonify({'message': 'Game not found!'}), 404
game.title = data.get('title', game.title) game.title = data.get('title', game.title)
game.image = data.get('image', game.image) game.image = data.get('image', game.image)
game.owned = data.get('owned', game.owned) # Update owned status if provided
db.session.commit() db.session.commit()
return jsonify({'message': 'Game updated!'}), 200 return jsonify({'message': 'Game updated!'}), 200