fix issue with additem

merge-requests/12/head
Matthew 2020-05-06 19:33:05 -04:00 committed by Bsian
parent 41b006557b
commit b8ff7aa494
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 4 additions and 2 deletions

View File

@ -33,8 +33,9 @@ export default class AddItem extends Command {
},
});
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.***`);
}
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();
} 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.ERROR} Invalid data code.***`);