From b448a462490d23a96d41e66192606a57b1838444 Mon Sep 17 00:00:00 2001 From: baz Date: Sat, 30 Dec 2023 01:55:51 +0000 Subject: [PATCH] Delete the most recent beaten game from a user is no paramete is supplied --- commands/100-games/deletegame.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/100-games/deletegame.js b/commands/100-games/deletegame.js index 0e49743..c36f0c0 100644 --- a/commands/100-games/deletegame.js +++ b/commands/100-games/deletegame.js @@ -16,7 +16,8 @@ module.exports = { result = await deleteBeatenGameNum(beatGameNumber, userDatabaseEntry); } else { - // TODO: Delete most recent game entry. + const recentGame = await getRecentGameEntry(userDatabaseEntry.id); + result = await deleteBeatenGameId(recentGame.id, userDatabaseEntry); } if (result) {