Wishlist: Fix TypeError on initial wishlist creation

On creation Characters are not included. Since a new wishlist
is empty anyway, we attach an empty array manually.
This commit is contained in:
2023-03-16 00:59:59 +01:00
parent 7bb02e2d3d
commit 793119dfc9

View File

@@ -43,9 +43,10 @@ module.exports = {
if(!wishlist) { if(!wishlist) {
wishlist = await Wishlist.create({ wishlist = await Wishlist.create({
ping: false, ping: false,
UserId: user.id UserId: user.id,
}); });
interaction.channel.send("Created new wishlist"); wishlist.Characters = []
await interaction.channel.send("Created new wishlist");
} }
switch (interaction.options.getSubcommand()) { switch (interaction.options.getSubcommand()) {
case "view": case "view":