mirror of https://github.com/zulip/zulip.git
bot_data: Rename delete to del.
`delete` is a reserved keyword that would interfere with the migration to an ES6 module. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
parent
b8839302c0
commit
bde31a54c7
|
@ -104,7 +104,7 @@ run_test('test_basics', () => {
|
|||
bot = bot_data.get(43);
|
||||
assert.equal('Bot 1', bot.full_name);
|
||||
assert(bot.is_active);
|
||||
bot_data.delete(43);
|
||||
bot_data.del(43);
|
||||
bot = bot_data.get(43);
|
||||
assert.equal(bot, undefined);
|
||||
}());
|
||||
|
|
|
@ -1002,7 +1002,7 @@ with_overrides(function (override) {
|
|||
event = event_fixtures.realm_bot__delete;
|
||||
global.with_stub(function (bot_stub) {
|
||||
global.with_stub(function (admin_stub) {
|
||||
override('bot_data.delete', bot_stub.f);
|
||||
override('bot_data.del', bot_stub.f);
|
||||
override('settings_users.update_user_data', admin_stub.f);
|
||||
dispatch(event);
|
||||
var args = bot_stub.get_args('bot_id');
|
||||
|
|
|
@ -42,7 +42,7 @@ var bot_data = (function () {
|
|||
send_change_event();
|
||||
};
|
||||
|
||||
exports.delete = function bot_data__delete(bot_id) {
|
||||
exports.del = function bot_data__del(bot_id) {
|
||||
delete bots[bot_id];
|
||||
delete services[bot_id];
|
||||
send_change_event();
|
||||
|
|
|
@ -198,7 +198,7 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
|
|||
event.bot.is_active = false;
|
||||
settings_users.update_user_data(event.bot.user_id, event.bot);
|
||||
} else if (event.op === 'delete') {
|
||||
bot_data.delete(event.bot.user_id);
|
||||
bot_data.del(event.bot.user_id);
|
||||
settings_users.update_user_data(event.bot.user_id, event.bot);
|
||||
} else if (event.op === 'update') {
|
||||
if (_.has(event.bot, 'owner_id')) {
|
||||
|
|
Loading…
Reference in New Issue