From 7db1c1cdcf617e146e927c4aadde239959a9d3de Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 7 Mar 2017 15:32:22 +0500 Subject: Implement SMS commands --- web/app/store/CommandTypes.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'web/app/store/CommandTypes.js') diff --git a/web/app/store/CommandTypes.js b/web/app/store/CommandTypes.js index ad5faba..445f937 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); + } } } }); -- cgit v1.2.3