Skip to content

Commit

Permalink
Initial wiring of users and devices APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Dec 2, 2015
1 parent dc99e22 commit d64dca6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 32 deletions.
4 changes: 2 additions & 2 deletions web/app/model/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Ext.define('Traccar.model.User', {
}],

proxy: {
type: 'ajax',
url: '/api/user/update',
type: 'rest',
url: '/api/rest/users',
writer: {
type: 'json',
writeAllFields: true
Expand Down
8 changes: 2 additions & 6 deletions web/app/store/AllDevices.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ Ext.define('Traccar.store.AllDevices', {
model: 'Traccar.model.Device',

proxy: {
type: 'ajax',
url: '/api/device/get',
type: 'rest',
url: '/api/rest/devices',
extraParams: {
all: true
},
reader: {
type: 'json',
rootProperty: 'data'
}
}
});
14 changes: 2 additions & 12 deletions web/app/store/Devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,9 @@ Ext.define('Traccar.store.Devices', {
model: 'Traccar.model.Device',

proxy: {
type: 'ajax',
api: {
create: '/api/device/add',
read: '/api/device/get',
update: '/api/device/update',
destroy: '/api/device/remove'
},
reader: {
type: 'json',
rootProperty: 'data'
},
type: 'rest',
url: '/api/rest/devices',
writer: {
type: 'json',
writeAllFields: true
}
}
Expand Down
14 changes: 2 additions & 12 deletions web/app/store/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,9 @@ Ext.define('Traccar.store.Users', {
model: 'Traccar.model.User',

proxy: {
type: 'ajax',
api: {
create: '/api/user/add',
read: '/api/user/get',
update: '/api/user/update',
destroy: '/api/user/remove'
},
reader: {
type: 'json',
rootProperty: 'data'
},
type: 'rest',
url: '/api/rest/users',
writer: {
type: 'json',
writeAllFields: true
}
}
Expand Down

0 comments on commit d64dca6

Please sign in to comment.