diff options
Diffstat (limited to 'web/app/store')
-rw-r--r-- | web/app/store/CommandTypes.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/web/app/store/CommandTypes.js b/web/app/store/CommandTypes.js index ad5faba2..445f937d 100644 --- a/web/app/store/CommandTypes.js +++ b/web/app/store/CommandTypes.js @@ -1,5 +1,6 @@ /* * Copyright 2016 Gabor Somogyi (gabor.g.somogyi@gmail.com) + * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,17 +20,9 @@ Ext.define('Traccar.store.CommandTypes', { extend: 'Ext.data.Store', fields: ['type', 'name'], - listeners: { - 'beforeload' : function (store) { - var proxy; - proxy = store.getProxy(); - proxy.setUrl('api/commandtypes?deviceId' + proxy.extraParams.deviceId); - } - }, - proxy: { type: 'rest', - url: '', + url: 'api/commandtypes', reader: { type: 'json', getData: function (data) { @@ -46,6 +39,11 @@ Ext.define('Traccar.store.CommandTypes', { }); return data; } + }, + listeners: { + 'exception' : function (proxy, response) { + Traccar.app.showError(response); + } } } }); |