fix issue with additem

merge-requests/11/merge
Matthew 2020-05-06 19:33:05 -04:00
parent d6689132a1
commit 9bd98e2ea4
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 4 additions and 2 deletions

View File

@ -33,8 +33,9 @@ export default class AddItem extends Command {
}, },
}); });
await newAccount.save(); await newAccount.save();
} } else {
await account.updateOne({ $addToSet: { 'additional.operatingSystems': args[0].split('-')[1] } }); await account.updateOne({ $addToSet: { 'additional.operatingSystems': args[0].split('-')[1] } });
}
return message.channel.createMessage(`***${this.client.util.emojis.SUCCESS} Added OS code ${args[0]} to profile.***`); return message.channel.createMessage(`***${this.client.util.emojis.SUCCESS} Added OS code ${args[0]} to profile.***`);
} }
if (args[0].split('-')[0] === 'lang' && ['js', 'py', 'rb', 'ts', 'rs', 'go', 'cfam', 'csharp', 'swift', 'java', 'kt', 'asm'].includes(args[0].split('-')[1])) { if (args[0].split('-')[0] === 'lang' && ['js', 'py', 'rb', 'ts', 'rs', 'go', 'cfam', 'csharp', 'swift', 'java', 'kt', 'asm'].includes(args[0].split('-')[1])) {
@ -48,8 +49,9 @@ export default class AddItem extends Command {
}, },
}); });
await newAccount.save(); await newAccount.save();
} } else {
await account.updateOne({ $addToSet: { 'additional.langs': args[0].split('-')[1] } }); await account.updateOne({ $addToSet: { 'additional.langs': args[0].split('-')[1] } });
}
return message.channel.createMessage(`***${this.client.util.emojis.SUCCESS} Added language code ${args[0]} to profile.***`); return message.channel.createMessage(`***${this.client.util.emojis.SUCCESS} Added language code ${args[0]} to profile.***`);
} }
return message.channel.createMessage(`***${this.client.util.emojis.ERROR} Invalid data code.***`); return message.channel.createMessage(`***${this.client.util.emojis.ERROR} Invalid data code.***`);