mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-22 22:05:21 +02:00
Initial version of transactions. Shell command implemented as an example. Still needs channel cleanup on app side, handling a device dying in the middle of a transaction, and getting device list back to normal.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
var oboe = require('oboe')
|
||||
var _ = require('lodash')
|
||||
var Promise = require('bluebird')
|
||||
|
||||
module.exports = function DeviceServiceFactory($rootScope, $http, socket) {
|
||||
var deviceService = {
|
||||
@@ -69,6 +70,13 @@ module.exports = function DeviceServiceFactory($rootScope, $http, socket) {
|
||||
insert(device)
|
||||
})
|
||||
|
||||
deviceService.list = function () {
|
||||
return $http.get('/api/v1/devices')
|
||||
.then(function(response) {
|
||||
return response.data.devices
|
||||
})
|
||||
}
|
||||
|
||||
deviceService.get = function (serial) {
|
||||
return $http.get('/api/v1/devices/' + serial)
|
||||
.then(function (response) {
|
||||
|
||||
Reference in New Issue
Block a user