Replace usages of gerRecentGameEntry with getRecentBeatenGameEntry

This commit is contained in:
baz 2024-02-11 19:42:07 +00:00
parent 693bb2b50f
commit e393589042
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const { getUserRegistration, deleteBeatenGameNum, checkGameStorageId, getRecentGameEntry, deleteBeatenGameId, getBeatenGameCount } = require('../../databaseHelperFunctions.js');
const { getUserRegistration, deleteBeatenGameNum, checkGameStorageId, getRecentBeatenGameEntry, deleteBeatenGameId, getBeatenGameCount } = require('../../databaseHelperFunctions.js');
const { getCoverURL, getGameJson } = require('../../igdbHelperFunctions.js');
module.exports = {
@ -19,7 +19,7 @@ module.exports = {
result = await deleteBeatenGameNum(beatGameNumber, userDatabaseEntry);
}
else {
const recentGame = await getRecentGameEntry(userDatabaseEntry.id);
const recentGame = await getRecentBeatenGameEntry(userDatabaseEntry.id);
result = await deleteBeatenGameId(recentGame.id, userDatabaseEntry);
}

View File

@ -1,6 +1,6 @@
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const { getCoverURL, getGameJson } = require('../../igdbHelperFunctions.js');
const { getUserRegistration, getRecentGameEntry, getBeatenGameCount } = require('../../databaseHelperFunctions.js');
const { getUserRegistration, getRecentBeatenGameEntry, getBeatenGameCount } = require('../../databaseHelperFunctions.js');
module.exports = {
data: new SlashCommandBuilder()
@ -18,7 +18,7 @@ module.exports = {
const userDatabaseEntry = await getUserRegistration(user);
if (!userDatabaseEntry) return interaction.reply({ content: `Issue checking registration with "${interaction.user.username}".`, ephemeral: true });
const gameDatabaseEntry = await getRecentGameEntry(userDatabaseEntry.id);
const gameDatabaseEntry = await getRecentBeatenGameEntry(userDatabaseEntry.id);
if (!gameDatabaseEntry) return interaction.reply({ content: 'No game found.', ephemeral: true });
const body = `where id = ${ gameDatabaseEntry.igdb_id }; fields *;`;